jQuery实现打开页面渐现效果示例
本文实例讲述了jQuery实现打开页面渐现效果的方法。分享给大家供大家参考,具体如下:
思路:把页面中所有的标签放到一个div中,然后再在最后添加一个空div标签fadeDiv,用fadeDiv遮挡body使fadeDiv渐现
<head>
<title></title>
<scriptsrc="jquery-1.7.2.min.js"type="text/javascript"></script>
<scripttype="text/javascript">
$(function(){
varp=$("body");
varoffset=p.offset();
$("#fadeDiv").css({top:offset.top,left:offset.left,width:$("#bodyDiv").width(),height:$("body").height(),backgroundColor:"white",opacity:1,position:"absolute"});
if(jQuery.isReady){
$("#fadeDiv").fadeOut(1000);
}
})
</script>
</head>
<body>
<formid="form1">
<divid="bodyDiv"></div>
<divid="fadeDiv"></div>
</form>
</body>
</html>
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery拖拽特效与技巧总结》、《jQuery表格(table)操作技巧汇总》、《jquery中Ajax用法总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。