页面代码:








hoverLight插件代码
;
(function($,window,document,undefined){
var defaults={
items:'li'||'a',
pOpc:'0.4',//浮层透明度
};
$.fn.hoverLight=function(options){
var opts=$.extend(defaults,options,undefined);
this.each(function(){
//激活事件
var obj=$(this).find(opts.items);
//创建浮层
var w=obj.width();
var h=obj.height();
floatp='';
obj.css('position','relative').append(floatp);
//添加事件
obj.each(function(){
var _this=$(this);
_this.on('mouseover',function(){
obj.children('p').css({'opacity':opts.pOpc,'filter':('alpha(opacity='+opts.pOpc*100+')')});
_this.children('p').css({'opacity':'0','filter':'alpha(opacity=0)'})
});
});
obj.each(function(){
var _this=$(this);
_this.on('mouseout',function(){
obj.children('p').css({'opacity':'0','filter':'alpha(opacity=0)'});
});
});
});
return this;
};
})(jQuery,window,document);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
欢迎选择我的课程,让我们一起见证您的进步~~