jquery 实现背景变暗的效果 类似登录、注册时的背景虚化效果

主要就是改变body的background-image属性,选一个图片,重复一下,半透明一下(请自行考虑兼容性),z order一下。搞定!

	$("#button2").click(function(){
		$("body").css({"background-image":"url(bg.jpg)","background-repeat":"repeat-x repeat-y","opacity":0.4,"z-index":"100"});
		$("body").css("background-repeat","repeat-x repeat-y");
		alert("gray");	
	})

Leave a Reply