2012-11-12 5 views
1

밖으로 슬라이드 나는 다음과 같은 일을 가지고 호버 (hover) 중에 바닥에 놓고, 내리지 않을 때는 바닥에서 밀어냅니다. 나는 여기저기서 몇 가지 자료를 보았지만 올바르게 이해할 수없는 것처럼 보였다. 이 경우 주 컨테이너 (1/3)의 크기가 조정되지 않는 것이 중요합니다. 캡션이 그 안에 있어야합니다. 이것을 어떻게 할 수 있습니까?캡션 - - 바닥에서의 슬라이드 하단

+0

왜 당신은 자바 스크립트를 사용하지? javascript 프레임 워크 인 jQuery를 사용하면 작업을보다 쉽게 ​​수행 할 수 있습니다. – itsazzad

+0

바이올린을 설치하고 싶습니까? http://jsfiddle.net – VIDesignz

+2

[무엇을 시도 했습니까?] (http://whathaveyoutried.com/)? –

답변

1

DEMO - 이와 비슷한?

CSS3 transition-duration (W3Schools)을 사용하여 애니메이션을 만듭니다.

업데이트 :

DEMO - 그래서 당신은 토스터 효과를 찾고?

업데이트 2 :

DEMO - jQuery를 .animate() 대신를 사용하여 애니메이션.

+0

아니요, 이것은 제가 의미하는 바가 아닙니다 ... 위에 게시 한 의견은 내가 더 잘 찾고있는 것을 설명합니다. – user756659

+0

귀하의 예제를 감안할 때, 내부 div 아래에 나타나지 않고 빨간색 캡션이 보이지 않는 것에서 아래쪽으로 보이고 아래쪽에 놓입니다 (네 번째 회색 선 위로). 마치 검은 상자 바닥에서 일어나는 것처럼. 또한 JQuery를 사용하여 크로스 브라우저 (css3 전환이 아님)를 사용하고 싶습니다. – user756659

+0

내 대답이 "토스터"예제로 업데이트되었습니다. – Coby

0

다음은 내가 결국 생각한 것입니다. 그것은 내가 필요한 모든 것을 다룹니다 ... 전복시 바닥에 토스트 쇼가 있습니다. 전체 div는 롤오버되었을 때 링크이며, 링크도 포함시킬 수 있습니다. '애니메이션'은 FF에서만 작동하지만 내 div에서 둥근 모서리를 사용하므로이 작업을 수행 ... 오버레이를 따르지 않는 이유가 무엇이든간에 건배 : 숨겨진 모서리가 둥글지 않도록 숨겨져 있습니다.

 <div class="one-third"> 
      <div class="inside"> 
       <a href="#"></a> 
       <h4><strong>How much can you save?</strong></h4> 
       <p>testing</p> 
       <p>testing</p> 
       <p><a class="link" href="#">testing</a></p> 
       <p>testing</p> 
       <span class="toast">Learn more about one</span> 
      </div> 
     </div> 

CSS :

.one-third{ 
border:1px solid #d8d8d8; 
margin:0 9px; 
-moz-border-radius: 6px; 
-webkit-border-radius: 6px; 
border-radius: 6px; 
background:#ffffff; 
text-align:center; 
position:relative; 
overflow:hidden; 
cursor: pointer; 

} 

.one-third:hover{ 
background: #eeeeee; 
} 

.one-third .inside{ 
padding:10px; 
} 

.one-third a{ /*entire div link*/ 
position:absolute; 
width:100%; 
height:100%; 
top:0; 
left: 0; 
/* edit: added z-index */ 
z-index: 1; 
} 

.one-third a.link { /*links on top of box*/ 
position:relative; 
z-index:2; 
} 

.one-third .inside .toast { 
background: rgb(71, 71, 71); /* Fall-back for browsers that don't support rgba */ 
background: rgba(0, 0, 0, .7); 
display: block; 
position: absolute; 
left: 0; 
width: 100%; 
bottom: -30px; 
line-height:30px; 
color: #fff; 
font-size:14px; 
text-align: center; 
transition: all 0.1s linear 0s; /*no moz, webkit, or o because radius is needed and won't scroll right*/  
-moz-border-radius: 0 0 6px 6px; 
-webkit-border-radius: 0 0 6px 6px; 
border-radius: 0 0 6px 6px; 
} 

.one-third:hover .toast { 
bottom: 0; 
}