html+css+js开发oppo音乐展示特效
2015-12-15 10:36
1006 查看
先上效果图
代码:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>oppo音乐展示特效</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
#box{
width:100%;
height:630px;
}
#box .pic{
width:100%;
height:630px;
overflow:hidden;/*溢出隐藏*/
}
#box .pic .op1{
background:url("img/bg1.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op2{
background:url("img/bg2.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op3{
background:url("img/bg3.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op1 img{
position: absolute;
left: -550px;
}
#box .pic .op2 img{
position: absolute;
left: -550px;
}
#box .pic li .nav{
background:#fff;
width:100%;
height:70px;
position:absolute;
left:0px;
bottom:0px;
opacity:0.75;
}
#box .pic li .bar{
width:1180px;
height:4px;
background:url(img/bar.png);
position:absolute;
bottom:30px;
left:90px;
}
#box .pic li .bar p{
width:0px;
height:3px;
background:green;
}
</style>
</head>
<body>
<audio src="MP3/oppo.mp3" autoplay loop></audio>
<div id="box">
<div class="pic">
<ul>
<li class="op1">
<img src="img/con1.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
<li class="op2">
<img src="img/con2.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
<li class="op3">
<img src="img/con3.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
</ul>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var i=0;
jumper();
function jumper(){
$("#box .pic ul li").eq(i).find("img").css("left","-600px");
$("#box .pic ul li").eq(i).find("p").css("width","0");
$("#box .pic ul li").eq(i).find("img").animate({left:"0px"},500,function(){
$("#box .pic ul li").eq(i).find("p").animate({width:"1177px"},8000,function(){
$("#box .pic ul li").eq(i).find("img").animate({left:"1280px"},500,function(){
i++;
if(i>2){
i=0;
}
$("#box .pic ul li").eq(i).fadeIn(1000).siblings().fadeOut(1000);//淡入淡出效果
});
});
});
}
setInterval("jumper()",10000);
</script>
</body>
</html>
代码:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>oppo音乐展示特效</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
#box{
width:100%;
height:630px;
}
#box .pic{
width:100%;
height:630px;
overflow:hidden;/*溢出隐藏*/
}
#box .pic .op1{
background:url("img/bg1.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op2{
background:url("img/bg2.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op3{
background:url("img/bg3.jpg") center;
list-style:none;
height:630px;
position:relative;
}
#box .pic .op1 img{
position: absolute;
left: -550px;
}
#box .pic .op2 img{
position: absolute;
left: -550px;
}
#box .pic li .nav{
background:#fff;
width:100%;
height:70px;
position:absolute;
left:0px;
bottom:0px;
opacity:0.75;
}
#box .pic li .bar{
width:1180px;
height:4px;
background:url(img/bar.png);
position:absolute;
bottom:30px;
left:90px;
}
#box .pic li .bar p{
width:0px;
height:3px;
background:green;
}
</style>
</head>
<body>
<audio src="MP3/oppo.mp3" autoplay loop></audio>
<div id="box">
<div class="pic">
<ul>
<li class="op1">
<img src="img/con1.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
<li class="op2">
<img src="img/con2.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
<li class="op3">
<img src="img/con3.png"/>
<div class="nav"></div>
<div class="bar">
<p></p>
</div>
</li>
</ul>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var i=0;
jumper();
function jumper(){
$("#box .pic ul li").eq(i).find("img").css("left","-600px");
$("#box .pic ul li").eq(i).find("p").css("width","0");
$("#box .pic ul li").eq(i).find("img").animate({left:"0px"},500,function(){
$("#box .pic ul li").eq(i).find("p").animate({width:"1177px"},8000,function(){
$("#box .pic ul li").eq(i).find("img").animate({left:"1280px"},500,function(){
i++;
if(i>2){
i=0;
}
$("#box .pic ul li").eq(i).fadeIn(1000).siblings().fadeOut(1000);//淡入淡出效果
});
});
});
}
setInterval("jumper()",10000);
</script>
</body>
</html>
相关文章推荐
- JavaScriptc创建对象的几种模式
- javascript函数执行环境创建过程及解析
- Javascript基于AJAX回调函数传递参数实例分析
- 模拟请求 get 、 post、put、delete 发送 xml\json\a=1&b=2&c= 等形式参数,代理设置
- JSP页面实现循环打印
- javascript实现html页面之间参数传递的四种方法实例分析
- jstl-functions的用法
- JSP入门之自定义标签
- href=#与href=javascript:void(0)的差异
- 认识js中的function和this---new Function(a,b,body)方式
- JSON美化输出
- 一些实用的js方法
- js方法使用技巧
- JavaScript解决页面undefined字符串问题
- datatables使用
- js实现继承的5种方式
- ExtJS4组件_form表单配置-属性-方法详解
- 怎么让Eclipse对html和js代码自动提示
- Javascript定义类(class)的三种方法
- js加载完成页面