按住鼠标左键可d出快捷菜单的jquery特效

按住鼠标左键可d出快捷菜单的jquery特效,第1张

概述按住鼠标左键可d出快捷菜单的jquery特效

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

(function($){	//ClassM	$.classM = function(options){		var defaults = {			content:"<div class='classM'><a href='http://www.datouwang.com/' target='_blank' class='M_1'></a><a href='http://www.datouwang.com/' target='_blank' class='M_2'></a><a href='JavaScript:;' class='M_3'></a><a href='http://www.zheye.cc/' target='_blank' class='M_4'></a></div>",//Content			wIDth:388,//this Tip WIDth			height:93,//this Tip Height			background:"images/bg.png",//this Tip Background			time:500,//show Time			animateTime:200//animate		}		var options = $.extend(defaults,options);		$(document).each(function(){			$("body").mousedown(function(e){				setM = setTimeout(mouseD,options.time);				winW = $(window).wIDth();				winH = $(document).height();				winX = e.originalEvent.x || e.originalEvent.layerX || 0;				winY = e.originalEvent.y || e.originalEvent.layerY || 0;				if ( winW-winX < options.wIDth ) { winX = winX-options.wIDth }				winScroll = $(document).scrolltop()				winY = winY+winScroll;			})			$("body").mouseup(function(){				clearTimeout(setM)			})			$(document).scroll(function(){				removeClassM()			})		})		mouseD = function mouseD(){			$("body").append("<div class='classMBg' style='position:absolute;top:0;left:0;background:#fff;wIDth:100%;height:"+winH+"px;z-index:9999;'></div>");			$(".classMBg")			.CSS("opacity","0")			.click(function(){removeClassM()});			$(".classMBox").remove();			$("body").append(			"	<div class='classMBox' style='position:absolute;top:"+winY+"px;left:"+winX+"px;z-index:99999;display:none;wIDth:0;text-align:center'>"			+	"<div style='wIDth:"+options.wIDth+"px;height:"+options.height+"px;background:url("+options.background+");'>"			+	options.content			+	"</div></div>");			$(".classMBox a").focus(function(){ $(this).blur() })			$(".classMBox a").hover(function(){ $(this).fadeto("slow",0.5) },function(){ $(this).fadeto("slow",1) })			$(".classMBox").show().animate({wIDth:options.wIDth+"px"},options.animateTime)			$(document).keydown(function(event){				if ( event.keyCode == 27 ) { removeClassM() }			})					}		function removeClassM(){			$(".classMBox").animate({wIDth:"0"},options.animateTime,function(){ $(".classMBg,.classMBox").remove() })		}	}	//	})(jquery);

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的按住鼠标左键可d出快捷菜单的jquery特效全部内容,希望文章能够帮你解决按住鼠标左键可d出快捷菜单的jquery特效所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1096208.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存