I have two clickable images inside a div
. They jump 3-6 pixels when 开发者_运维知识库clicked. If I set it to fixed or absolute it doesn't jump but floating the elements together in one div
is good formatting.
<div class="buttons">
<a onclick="$('.positionHelper').scrollTo( {top:'-=100px', left:'0'}, 800 );" href="#">
<img src="images/up.png" />
</a>
<a onclick="$('.positionHelper').scrollTo( {top:'+=100px', left:'0'}, 800 );" href="#">
<img src="images/down.png" />
</a>
</div>
.buttons {
float: left;
margin-top: -34px;
position: relative;
top: 100%;
}
Set the line-height of .buttons to 0.
精彩评论