在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:davist11/jQuery-Stickem开源软件地址:https://github.com/davist11/jQuery-Stickem开源编程语言:JavaScript 87.2%开源软件介绍:Make items sticky as you scroll, to a point. (See Demo) Usage<div class="container"> <div class="row stickem-container"> <div class="content"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> <div class="aside stickem"> I'm gonna be sticky! </div> </div> </div> .stickem-container { position: relative; } .stickit { margin-left: 660px; position: fixed; top: 0; } .stickit-end { bottom: 40px; position: absolute; right: 0; } $('.container').stickem(); Defaultsitem: '.stickem' container: '.stickem-container' stickClass: 'stickit' endStickClass: 'stickit-end' offset: 0 start: 0 onStick: null onUnstick: null DestroyingIf you have a bunch of stuff that happens after your page has loaded (e.g. AJAX requests) that changes the height of your containers and page, and you need to "destroy" stick 'em, do it like this: var sticky = $('.container').stickem(); sticky.destroy(); Then you can re-instantiate again if you need to. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论