-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLUNBO_demo1.html
135 lines (129 loc) · 3.28 KB
/
LUNBO_demo1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin:0 auto;
padding:0;
}
.bannar{
width:100%;
height:490px;
position:relative;
}
.img{
width:100%;
height:490px;
overflow:hidden;
}
.img ul li{
width:100%;
height:490px;
list-style-type: none;
display:none;
}
.text{
width:1000px;
height:6px;
position:absolute;
bottom:28px;
left:50%;
margin-left:-500px;
}
.nav{
width:1000px;
height:10px;
position:absolute;
bottom:4px;
left:50%;
margin-left:-500px;
}
.text ul li{
width:200px;
height:100%;
float:left;
margin-left:38px;
list-style-type: none;
}
.nav ul li{
width:200px;
height:10px;
float:left;
margin-left:38px;
list-style-type: none;
background:gray;
}
.nav ul li p{
width:0px;
height:100%;
background:red;
float:left;
}
</style>
</head>
<body>
<div class="bannar">
<div class="img">
<ul>
<li style="background:url(http://www.w3cplus.com/demo/css3/CSS3Fullbackground/bg1.jpg);display:block;"></li>
<li style="background:url(http://www.w3cplus.com/demo/css3/CSS3Fullbackground/bg2.jpg);"></li>
<li style="background:url(http://www.w3cplus.com/demo/css3/CSS3Fullbackground/bg3.jpg);"></li>
<li style="background:url(http://www.w3cplus.com/demo/css3/CSS3Fullbackground/bg4.jpg);"></li>
</ul>
</div>
<!--<div class="text">
<ul>
<li>0</li>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div>-->
<div class="nav">
<ul>
<li><p></p></li>
<li><p></p></li>
<li><p></p></li>
<li><p></p></li>
</ul>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script>
var i=0;
var time_id=null;
function auto(){
$(".nav ul li").eq(i).find("p").animate({
"width":"200px"
},3900,function(){
i++;
$(this).css("width", '0px');
if(i>3){
i=0;
}
$(".img ul li").eq(i).fadeIn(300).siblings().fadeOut(300);
});
}
time_id=setInterval("auto()",4000);
/*$(".text ul li").click(function(){
$(".nav ul li").find("p").stop().css("width","0px");
clearInterval(time_id);
i=$(this).index();
$(".img ul li").eq(i).fadeIn().siblings().fadeOut();
auto();
time_id=setInterval("auto()",4000);
});
*/
$(".nav ul li").click(function(){
$(".nav ul li").find("p").stop().css("width","0px");
clearInterval(time_id);
i=$(this).index();
$(".img ul li").eq(i).fadeIn().siblings().fadeOut();
auto();
time_id=setInterval("auto()",4000);
})
</script>
</body>
</html>