2013-04-18 49 views
2

如何在滚动页面时以及何时点击首页时创建图像模式。 我希望速度箭头上下移动,而不是在我滚动页面时放弃。滚动时移动图像

顺便说一句,我使用JQuery的运动

enter image description here

enter image description here

<div class="FirstChildBox"> 
       <div class="imageBox"> 
         <img src="textimage2.jpg" id="imageBoxImg"/> 
        <form> 
          <label class="Image1BoxLabel"><input type="checkbox"/>Image1</label> 
         <label class="Image1BoxLabel"><input type="checkbox"/>Image1</label> 
         <label class="Image1BoxLabel"><input type="checkbox"/>Image1</label>1 
         </form> 
         <a href="#">Enemy1</a> 
       </div> 
       <div class="rateImage"> 
        <div class="arrowupdownrate"> 
         <div class="upArrow" id="upArrow"><img src="up_down.png" /> </div> 
         <div class="rateNumber"><a>112320</a></div> 
         <div class="downArrow" id="downArrow"><img src="red_down.png" /></div> 
        </div> 
       </div> 

    </div> 

回答

0

修复rateImage到最近relative父的右上角。在这种情况下,文件。

.rateImage { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
} 

或者,你可以使用:

.rateImage { 
    position: fixed; 
    top: 10px; 
    right: 10px; 
} 

我喜欢position: absolute;,只是因为它最终被从长远来看,更加灵活。在这种情况下真的没关系。

+0

它没有阻止它打它只是停留在顶部的最大高度之后 –

0

给位置:固定速率的div

.rateImage { 
position: fixed; 
} 
+0

它没有停止它达到最大高度后它只停留在顶部 –

+0

像[this](http://jsfiddle.net/anpsmn/BwwuV/12/)? – anpsmn

0

以下内容添加到您的upArrowdownArrow CSS类:

position: fixed