1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > jQuery实现返回顶部功能【jquery】

jQuery实现返回顶部功能【jquery】

时间:2021-01-15 08:16:52

相关推荐

jQuery实现返回顶部功能【jquery】

web前端|js教程

jQuery返回顶部

web前端-js教程

代码很简单,这里就不多废话了,小伙伴们看代码吧。

网页游戏源码站,vscode工程构成详解,ubuntu录音工具,tomcat关闭开机启动,post爬虫参数,ecshop php7,seo友情链接交换,织梦网站后台密码错误,hishop模板lzw

HTML:

开奖结果源码,ubuntu18苹果,tomcat9安全加固,草爬虫品种,php开发都做什么,seo供应lzw

去顶部

CSS:

商品管理系统源码,vscode 改图标,Ubuntu建立,java导tomcat,sqlite相同数据类型,模板插件分享群,web前端框架心得体会,python爬虫文件下载工具,iis6 php 配置,台州站内seo优化,私人记事本网站源码,asp access网页模板,jquery 滚动翻页模板lzw

.fl{ display:block; float:left; width:50px; height:50px; text-align:center; background-color:#eaeaea; background-image:url(../images/toTop.jpg); } .fl:hover{background-color:#f48942;background-image:url(../images/toTop.jpg);} #Fixed { position: fixed; _position: absolute; z-index: 100; bottom: 70px; left: 50%; margin-left: 530px; _bottom: auto;_top: expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-70); width: 50px; text-indent: -40000px; background: #fff } /*置顶 end*/

Js:

/*置顶功能*/ $(function(){ $(window).bind(scroll, { fixedOffsetBottom: parseInt($(#Fixed).css(ottom)) }, function(e) { var scrollTop = $(window).scrollTop(); var referFooter =$(#footer); scrollTop > 100 ? $(#goTop).show() : $(#goTop).hide(); if (!/msie 6/i.test(navigator.userAgent)) {if ($(window).height() - (referFooter.offset().top - $(window).scrollTop()) > e.data.fixedOffsetBottom) { $(#Fixed).css(ottom, $(window).height() - (referFooter.offset().top - $(window).scrollTop()))} else { $(#Fixed).css(ottom, e.data.fixedOffsetBottom)} } }); $(#goTop).click(function() { $(ody,html).stop().animate({scrollTop: 0,duration: 100,easing: ease-in }) }); }); /*置顶功能 end*/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。