我希望自己的徽标图片向上移动而不影响其下方的措辞,但即使这些元素位于不同的div中,也会触发这两个元素,而这些div都包含在父div中。我不明白。我假设它与边距有关,但是当我尝试反向设置文本元素的相反值时,表现出奇怪的行为。保证金变化会导致多个div受到影响
CSS:
.full-circle {
display:block;
margin:auto;
margin-top: 15px;
overflow: hidden;
height: 180px;
width: 180px;
border: 2px solid #FFF;
-moz-border-radius: 90px;
-webkit-border-radius: 90px;
background:#FDF5E6;
-webkit-transition: margin 0.2s ease-out;
-moz-transition: margin 0.2s ease-out;
-o-transition: margin 0.2s ease-out;
}
.full-circle:hover{margin-top: 2px;}
的jQuery:
$('.full-circle').hover(
function(){
$(this).stop().animate(
{marginTop: '2'}, 20, 'linear'
);//end animate
},//end function
function(){
$(this).stop().animate(
{marginTop: '15'}, 20, 'linear'
);//end animate
}//end function
);//end hover
@ user1479606我做了 – 2013-04-08 12:55:05
非常感谢:) – Eli 2013-04-08 13:10:47