0
A
回答
0
我想你的报价框的CSS是这样
#quote-icon{
position: fixed;
top: 0;
}
尝试并添加
<script type="text/javascript">
$(document).ready(function() {
var top = $('#quote-icon').offset().top - parseFloat($('#quote-icon').css('marginTop').replace(/auto/, 0));
$(window).scroll(function (event) {
var y = $(this).scrollTop();
//if y > top, it means that if we scroll down any more, parts of our element will be outside the viewport
//so we move the element down so that it remains in view.
if (y >= top) {
var difference = y - top;
$('#quote-icon').css("top",difference);
}
});
});
</script>
1
我猜你希望它是固定的...所以:position: fixed;
可能帮助。
相关问题
- 1. 警报对话框关闭,无需按下按钮,活动进入主页
- 2. asp.net页面进行滚动
- 3. 滚动报价器的CSS标记
- 4. 列表框滚动条不按照选定的项目(与ICollectionView)
- 5. 使DIV滚动条主页滚动条?
- 6. 使用Jquery进行页面滚动
- 7. iOS禁用页面使用溢出滚动进行滚动:touch
- 8. 如何让报价器从页面的零px从右到左滚动
- 9. 滚动型进行滚动内SlidingDrawer
- 10. 删除主页上滚动的空间
- 11. 如何在按下硬件主页按钮时显示警报对话框?
- 12. 使用其编辑器进行并排降价预览滚动
- 13. 添加“报价”按钮,jwysiwyg
- 14. 主页键按压行为
- 15. 在线报价页面
- 16. Django按照主键JSON
- 17. Facebook的水平滚动条在报价和聊天栏
- 18. 在网页上滚动div而不滚动Selenium Webdriver中的主页
- 19. WPF滚动文本框的按钮
- 20. JQuery页面滚动动画框架
- 21. RecyclerView滚动进行更改
- 22. 面板进行滚动
- 23. 如何删除主页滚动并仅允许iframe滚动?
- 24. 与主页侧栏滚动iframe
- 25. 如何使主页模式滚动
- 26. 网页将不会滚动
- 27. 页面滚动发行
- 28. 将动画滚动到滚动上的特定页面位置
- 29. 按主旨进行查询的次数
- 30. 按主页按钮而进度对话框被显示抛出异常
那么最新的问题? – Thaillie