html首页滚动插件,利用js实现网页滚动条插件mousescroll.

特效描述:利用js实现 网页滚动条 插件mousescroll.。利用js实现网页滚动条插件mousescroll.

代码结构

1. 引入JS

2. HTML代码

在每个匹配元素的上下文中执行一个函数。

这意味着每次执行传入的函数(对于每个匹配的元素都是一次),“this”关键字指向特定的DOM元素。

此外,函数在执行时传递一个参数,表示元素在匹配集(整数,零索引)中的位置。

在每个函数中返回'false'会完全停止遍历所有元素的循环(这就像使用正常循环的'break'一样)。 从循环中返回'true'跳到下一次迭代(这就像使用正常循环的'continue'一样)。

在每个匹配元素的上下文中执行一个函数。

这意味着每次执行传入的函数(对于每个匹配的元素都是一次),“this”关键字指向特定的DOM元素。

此外,函数在执行时传递一个参数,表示元素在匹配集(整数,零索引)中的位置。

在每个函数中返回'false'会完全停止遍历所有元素的循环(这就像使用正常循环的'break'一样)。 从循环中返回'true'跳到下一次迭代(这就像使用正常循环的'continue'一样)。

在匹配集中的指定索引处访问单个匹配的DOM元素。

这使您可以提取实际的DOM元素并直接对其进行操作,而无需在其上使用jQuery功能。 这个被称为$(this).get(0)的函数相当于在jQuery对象本身上使用方括号表示法,如$(this)[0]。

Extends the jQuery object itself.

Can be used to add functions into the jQuery namespace. See 'jQuery.fn.extend' for more information on using this method to add Plugins.

Extends the jQuery element set to provide new methods (used to make a typical jQuery plugin).

Can be used to add functions into the to add plugin methods (plugins).

Run this function to give control of the $ variable back to whichever library first implemented it.

This helps to make sure that jQuery doesn't conflict with the $ object of other libraries.

By using this function, you will only be able to access jQuery using the 'jQuery' variable. For example, where you used to do $("div p"), you now must do jQuery("div p").

NOTE: This function must be called after including the jQuery javascript file, but before including any other conflicting library, and also before actually that other conflicting library gets used, in case jQuery is included last.

// 在这里修改id,和速度

$(function(){

var api1 = new myApi();

api1.mouseScroll.inte($('#scrolllayout'),10);

var api2 = new myApi();

api2.mouseScroll.inte($('#div1'),10);

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值