帝王谷资源网 Design By www.wdxyy.com
具体代码如下所示:
<!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>平滑滚动</title> <!--[if (gte IE 9)|!(IE)]><!--> <script src="assets/js/jquery.min.js"></script> <!--<![endif]--> <!--[if lte IE 8 ]> <script src="assets/ie8/jquery.min.js"></script> <script src="assets/ie8/modernizr.js"></script> <script src="assets/js/amazeui.ie8polyfill.min.js"></script> <![endif]--> <script src="assets/js/amazeui.min.js"></script> <link rel="stylesheet" href="assets/css/amazeui.min.css"> </head> <body style="margin:300px;"> <!-- $('html, body').animate({scrollTop: 0}, '500'); //兼容旧版IE的写法 --> <div style="height: 2000px;"></div> <!-- 滚动到顶部 --> <button data-am-smooth-scroll class="am-btn am-btn-success">滚动到顶部</button> <!-- 滚动到底部 --> <button id="doc-scroll-to-btm" class="am-btn am-btn-primary">滚动到底部</button> <script> $('#doc-scroll-to-btm').on('click', function() { var $w = $(window); $w.smoothScroll({position: $(document).height() - $w.height()}); }); </script> <!-- 定义选项 --> <button data-am-smooth-scroll="{position: 57, speed: 5000}" class="am-btn am-btn-danger">慢悠悠地滚到距离顶部 57px 的位置</button> <!--通过 Data API--> <!-- 在元素上添加 data-am-smooth-scroll 属性。 --> <button data-am-smooth-scroll class="am-btn am-btn-success">滚动到顶部</button> <!-- 如果要指定滚动的位置,可以给这个属性设一个值。 --> <button data-am-smooth-scroll="{position: 189}" class="am-btn am-btn-secondary">指定滚动的位置</button> <!-- 通过 Javascript $(window).smoothScroll([options]); // 滚动到底部 $('#my-button').on('click', function() { var $w = $(window); $w.smoothScroll({position: $(document).height() - $w.height()}); }); --> <div style="height: 2000px;"></div> </body> </html>
效果图:
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年06月26日
2024年06月26日
- 瑞鸣音乐《中国音乐地图之听见河南豫剧经典唱段》2020[WAV分轨]
- 【伊比萨沙发】VA-2024-IbizaSpring2024(LoungeCocktailsfromtheHeart)[FLAC]
- 群星《世界顶级汽车音响试音王》4K金碟16CD[WAV+CUE]
- 群星-音效环绕天碟《极致环绕人声天碟天品》7CD[WAV]
- 泰拉克SACD古典试音碟7SACD-ISO
- 群星《红歌宝典》20CD[WAV/分轨]
- 《101系列:好歌101首 细听年代精选》[WAV+CUE][3.6GB]
- 《101系列 6CD 国语经典101首歌曲 张学友 王菲代表作》[APE+CUE][2.8GB]
- 《101系列:国语经典101 VOL2 6CD 精选最经典101首》[WAV+CUE][2.3GB]
- 群星《十年网络红歌》15CD[WAV分轨]
- 宝丽金-环球10周年至50周年经典金曲15CD[低速原抓WAV+CUE]
- FIM唱片《十大男伶》[低速原抓WAV+CUE]
- 《101系列:情歌101 6CD》[WAV+CUE][3.1GB]
- 庄心妍《降调版合集》[320K/MP3][52.96MB]
- 庄心妍《降调版合集》[FLAC/分轨][118.78MB]