[jquery]图片延长二秒显示出来怎么写啊
delay(2000);写在哪里,放在哪里,举个例子<center><imgsrc="images/1.gif"/></center></div><scriptlangu...
delay(2000);写在哪里,放在哪里,举个例子
<center><img src="images/1.gif" /></center>
</div>
<script language="javascript">
$(document).ready(function(){
.........
});
</script> 展开
<center><img src="images/1.gif" /></center>
</div>
<script language="javascript">
$(document).ready(function(){
.........
});
</script> 展开
1个回答
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script language="javascript">
$(document).ready(function(){
$('#myimg').css('display', 'none');
$('#myimg').load(function(){
alert('图片加载完毕,在点击确认2秒后,图片出现。');
$(this).delay(2000).fadeIn(400);
});
});
</script>
</head>
<body>
<center><img id="myimg" src="http://www.baidu.com/img/baidu_logo.gif" /></center>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script language="javascript">
$(document).ready(function(){
$('#myimg').css('display', 'none');
$('#myimg').load(function(){
alert('图片加载完毕,在点击确认2秒后,图片出现。');
$(this).delay(2000).fadeIn(400);
});
});
</script>
</head>
<body>
<center><img id="myimg" src="http://www.baidu.com/img/baidu_logo.gif" /></center>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询