Javascript:当div通过jQuery到达浏览器的顶端时,它总是保持在顶端 [英] Javascript: have div always remain at the top when it reaches the top edge of browser with jquery

查看:95
本文介绍了Javascript:当div通过jQuery到达浏览器的顶端时,它总是保持在顶端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何拥有一个始终保持在屏幕上的div?比方说,我在左边的网站上有一个div。当浏览器滚动到底部时,只有当div顶部到达浏览器屏幕的顶部边缘以便它不会被隐藏时,div才会保持在那里。我也在使用jquery。



谢谢。

解决方案

这是一个Good ScreenCast,由RemySharp关于这个问题



http:

演示页面:



http://static.jqueryfordesigners.com/demo/fixedfloat.html


how to have a div that always stay on the screen? Lets say i have a div at the left hand site. When the browser is scroll to the bottom, the div will remain there ONLY when its' top reaches the top edge of browser screen so that it will not be hidden. I am using jquery too.

Thank you.

解决方案

here is a Good ScreenCast By RemySharp Regarding this Issue

http://jqueryfordesigners.com/fixed-floating-elements/

Demo Page :

http://static.jqueryfordesigners.com/demo/fixedfloat.html

这篇关于Javascript:当div通过jQuery到达浏览器的顶端时,它总是保持在顶端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆