加载图片后
怎么加淡入效果?
代码如下:
onload = function() {
$('#bg').attr('src','1.jpg');
}
怎么加淡入效果?
代码如下:
onload = function() {
$('#bg').attr('src','1.jpg');
}
解决方案 »
- jquery的each方法如何退出循环?
- 我哪里计算错了啊 .怎么点"前进"移动的位置错位了呢?
- 请教个使用日期函数的简单问题
- (挑战性问题)如何实现:生成一个网页的缩略图, 比如我想打开一个页面(见内)!
- javascript中如何得到四个移动键的信息?
- 问一个辣手的问题?????
- 发送页面时,如果用javascript判断textfield中填入的是数字(只能填数字)
- 急!如何用javascript判断html中的checkbox是否被选中??各路大侠,大虾都来看看呀!
- js创建链接无效?
- 求大神指点一下
- 如何设置html文件只能使用IE打开,不能使用记事本等其他程序打开?
- 有关表单的清空按钮
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- 引入jQuery -->
<script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
<style>
.header{
background:#fff url(images/banner_05a.jpg) no-repeat;
height:133px;
width:963px;
float:left;
position:relative;
}
.header img {
vertical-align:top;
position:absolute;
right:0;
}
</style>
<script language="javascript" type="text/javascript">
$(function(){
$(".header img").fadeOut(0).eq(0).fadeIn(0);
var i = 0;
setInterval(function(){
if($(".header img").length > (i+1)){
$(".header img").eq(i).fadeOut(2000).next("img").fadeIn(2000);
i++;
}
else{
$(".header img").eq(i).fadeOut(2000).siblings("img").eq(0).fadeIn(2000);
i = 0;
}
},3000);
})
</script>
</head>
<body>
<div class="header">
<img alt="JQuery实现淡入淡出效果" src="templatemo_image_01.jpg">
<img alt="JQuery实现淡入淡出效果" src="templatemo_image_02.jpg">
<img alt="JQuery实现淡入淡出效果" src="templatemo_image_03.jpg">
</div>
</body>
</html>
试一下!