开发者

Images jump 5 pixels on click

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜