滚动时移动图像

时间:2013-04-18 20:28:49

标签: jquery css

当我滚动页面以及它到达首页时,如何进行图像模式。 当我滚动时,我希望上下速率箭头沿着首页移动而不会降低。

BTW我正在使用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>

3 个答案:

答案 0 :(得分:0)

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

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

或者,您可以使用:

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

我更喜欢position: absolute;,因为从长远来看它最终会变得更加灵活。在这种情况下,这无关紧要。

答案 1 :(得分:0)

给出位置:固定到费率div

.rateImage {
 position: fixed;
}

答案 2 :(得分:0)

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

position: fixed
相关问题