大佬教程收集整理的这篇文章主要介绍了jquery – 在Div内部滚动时将DIV定位为固定时闪烁,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
function adjustPositions(E) { var div = e ? $(this) : $('.parent'); div.find('.left').css({ left: div.scrollLeft() + "px" }); var right = div.find('.right'); right.css({ left: div.scrollLeft() + div.width() - right.width() + "px" }); div.find('.header').css({ top: div.scrollTop() + "px" }); var bottom = div.find('.footer'); bottom.css({ top: div.scrollTop() + div.height() - bottom.height() + "px" }); } adjustPositions(); $('.parent').on('scroll',adjustPositions);
这是小提琴http://jsfiddle.net/8NL2S/5/,当我在Safari中测试它时,它闪烁.没什么好看的. Safari多次在同样的情况下踢了我的希望.我怎样才能解决这个问题.
HTML: <div class="parent"> <div class="static cf"> <div class="left"></div> <div class="right"></div> <div class="header"></div> <div class="footer"></div> </div> </div> CSS: .header{ border:1px solid red; width:100px; height:100px; BACkground-color:#F2F2F2; float:left; top:0px; left:0px; z-index:10; } .left{ border:1px solid red; height:100px; width:100px; left:0px; float:left; top:100px; BACkground-color:#CCc; } .right{ border:1px solid red; height:100px; width:100px; right:0px; float:left; top:100px; BACkground-color:#CCc; } .footer{ border:1px solid red; width:100px; height:100px; BACkground-color:#F2F2F2; float:left; left:0px; bottom:0px; z-index:10; } .static{ height:105px; width:410px; position:relative; } .cf{Clear:both}
以上是大佬教程为你收集整理的jquery – 在Div内部滚动时将DIV定位为固定时闪烁全部内容,希望文章能够帮你解决jquery – 在Div内部滚动时将DIV定位为固定时闪烁所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。