编程开发

展开

jquery smoothscroll.js

大小:33.3M语言:中文 类别:编程开发系统:WinAll, WinXP, Win7, Win8
简介|教程|评论(0)
软件性质:国产软件时间:2022-03-21 11:42:41

标签: smoothscroll.js.js

软件介绍

smoothscroll.js是一款JQuery的插件,可用来制作平滑滚动效果,方便软件开发者们的工作,需要的朋友欢迎来绿色资源网免费下载!

smoothscroll.js插件介绍

smoothscroll.js是一款纯js页面平滑滚动插件。该js页面平滑滚动插件的特点是页面滚动的行为被作为window对象的扩展,用户可以通过window对象直接调用平滑滚动的方法。

smooth scroll.min.js

smoothscroll.js使用步骤

1、引入以下的js和css文件

<scriptsrc="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>

<scriptsrc="../src/jquery.smooth-scroll.js"></script>

<scriptsrc="../lib/jquery.ba-bbq.js"></script>

2、在head标签中加入以下js代码

$(function(){

$("#btn").click(function(){

$('a').smoothScroll({

//参数列表

});

});

})

3、在body标签中加入相应的标签

插件使用说明

1、允许我们轻易地实现滑动到页面某个位置

2、可以这样来调用插件

$('a').smoothScroll();

3、可以根据自己的需要指定一个外部容器,那么滚动就是在这个容器内发生,而不是在页面级别发生了

$('#containera').smoothScroll();

4、可以通过下面的方式来排除指定容器的包含元素

$('#containera').smoothScroll({

excludeWithin:['.container2']

});

5、通过下面的语句来排除满足指定条件的元素

$('a').smoothScroll({

exclude:['.rough','#chunky']

});

6、调整滑动到哪个位置就停止

$('.backtotop').smoothScroll({

offset:-100

});

7、设定一个滑动开始之前的回调函数

$('a').smoothScroll({

beforeScroll:function(){

alert('readytogo!');

}

});

8、设定一个滑动结束的回调函数

$('a').smoothScroll({

afterScroll:function(){

alert('wemadeit!');

}

});

9、可以添加一个按钮用来支持点击后回到之前的位置,实际上就是一个历史记录的作用

加载全部内容

热门推荐
推荐教程
猜你喜欢
相关合集
用户评论
本类排行