jQuery脚本:
<script type="text/javascript"> $(function() { var scrollDiv = document.createElement('div'); $(scrollDiv).attr('id', 'toTop').html('^ 返回顶部').appendTo('body'); $(window).scroll(function() { if ($(this).scrollTop() != 0) { $('#toTop').fadeIn(); } else { $('#toTop').fadeOut(); } }); $('#toTop').click(function() { $('body,html').animate({ scrollTop: 0 }, 800); }) }); </script>
CSS样式:
<style type="text/css"> #toTop { width: 100px; z-index: 10; border: 1px solid #333; background: #121212; text-align: center; padding: 5px; position: fixed; bottom: 0px; right: 0px; cursor: pointer; display: none; color: #fff; text-transform: lowercase; font-size: 0.9em; } </style>
带有iframe框架的滚动操作:
<script type="text/javascript"> <!-- $().ready(function() { $('<div id="return_old_tips" class="btn_return_old" style="position:' + ($.browser.msie "absolute" : "fixed") + ';" onclick="return_old({$feedback_flag},\'{$current_url}\')">返回旧版</div>').appendTo($("body")); if ($.browser.msie) { $("#return_old_tips").css("top", 200); } if ($.browser.msie) { top.document.body.onscroll = function() { var f = 200 + (top.document.documentElement.scrollTop || top.document.body.scrollTop); if (f > parseInt($("body").height(), 10)) { f = parseInt($("body").height(), 10); } $("#return_old_tips").css({ top: f, left: 0 }); } top.document.body.onresize = top.document.body.onscroll; } else { $(window.parent.document).scroll(function() { var f = 200 + (top.document.documentElement.scrollTop || top.document.body.scrollTop); if (f > parseInt($("body").height(), 10)) { f = parseInt($("body").height(), 10); } $("#return_old_tips").css({ top: f, left: 0 }); }).resize(function() { var f = 200 + (top.document.documentElement.scrollTop || top.document.body.scrollTop); if (f > parseInt($("body").height(), 10)) { f = parseInt($("body").height(), 10); } $("#return_old_tips").css({ top: f, left: 0 }); }); } }); //--> </script>
以上所述是小编给大家介绍的jQuery实现返回顶部按钮和scroll滚动功能[带动画效果],希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年09月24日
2024年09月24日
- 时代少年团《「叁重楼」演唱会 -「楼间楼」重庆站LIVE》[320K/MP3][278.08MB]
- 时代少年团《「叁重楼」演唱会 -「楼间楼」重庆站LIVE》[FLAC/分轨][820.86MB]
- 许廷铿2017《THEULTIMATECOLLECTION》2CD[星梦娱乐][WAV+CUE]
- 许佳慧-独家情话[WAV+CUE]
- 张惠妹《ThePowerOfA-Mei》2018[SACD/ISO]
- 陈珊妮.2013-低调人生2CD【和气音乐】【WAV+CUE】
- 群星.2000-超级BAND.BAND.BAND【滚石】【WAV+CUE】
- 许志安.2002-On.Show演唱会2CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 蔡琴-哈利路亚2016[SACD/ISO]
- 陈随意2011-今生只为你[豪记][WAV+CUE]
- 陈随意2008-爱的总铺师[美华][WAV+CUE]
- 裘德《一棵树所创造的》[320K/MP3][56.21MB]
- 裘德《一棵树所创造的》[24bit 48kHz][FLAC/分轨][355.1MB]
- 卓依娜姆《美人谋 网剧影视原声带》[320K/MP3][48.29MB]
- 张星特.2024-流绪呢喃【中视鸣达】【FLAC分轨】