如何用jQuery实现弹出一个层然后过3秒钟后自动变淡然后消失
推荐于2018-02-26
展开全部
<!DOCTYPE HTML>
<html>
<head>
<meta charset=UTF-8>
<title>recursion</title>
<style type="text/css">
body {
overflow: hidden;
}
</style>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$ (function ()
{
$ (':button').click (function ()
{
$ ('div').show ().delay (3000).fadeOut ();
});
});
</script>
</head>
<body>
<button>alert</button>
<div
style="display: none; width: 1265px; height: 784px; position: absolute; top: 0px; left: 0px; background-color: rgb(45, 45, 45); z-index: 5000; opacity: 0.2; background-position: initial initial; background-repeat: initial initial;"></div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询