标签:style blog io ar color sp on div log
(function($) { $.fn.sideFixed = function(options) { var opts = $.extend(true, {}, $.fn.sideFixed.defaults, options); return this.each(function() { var $this = $(this); $this.on("mouseenter",function() { $(".mask").stop().animate({opacity:0.4}); $(".mask").show(); $(".mask").css({ width:$(document).outerWidth(), height:$(document).outerHeight() }); if(opts.direction==="right"){ $(this).stop().animate({ right:"0px" },800); }else if(opts.direction==="left"){ $(this).stop().animate({ left:"0px" },800); } }).on("mouseleave",function() { $(".mask").stop().fadeOut(800); $(".mask").stop().animate({opacity:0},function(){$(".mask").hide();}); if(opts.direction==="right"){ $(this).stop().animate({ right:-$(this).width() }); }else if(opts.direction==="left"){ $(this).stop().animate({ left:-$(this).width() }); } }); }); }; $.fn.sideFixed.defaults = { direction:"left" }; })(jQuery);
标签:style blog io ar color sp on div log
原文地址:http://www.cnblogs.com/dingyuanxin/p/4120358.html