码迷,mamicode.com
首页 > Web开发 > 详细

jquery视差图片切换

时间:2017-07-20 17:24:08      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:blank   val   res   图片切换   no-repeat   bsp   set   文字   attr   

<!DOCTYPE html>
  <html>
   
  <head>
  <meta charset="UTF-8">
  <title>视差图片文字切换</title>
  <script src="js/jquery-2.1.0.js"></script>
  <style>
  .box {
  width:750px;
  height: 750px;
  border: 1px solid red;
  overflow: hidden;
  margin-left: 300px;
  position: absolute;
  background:url("img/DSC05940.JPG")no-repeat center;
  }
   
  img {
  width: 1000px;
  height: 750px;
  position: absolute;
  }
  .fontbox{
  width:3750px;
  height: 750px;
  position: absolute;
  left: 0;
  }
  .font{
  float: left;
  width: 750px;
  height: 750px;
  line-height: 750px;
  text-align: center;
  font-size: 80px;
   
  }
  </style>
  </head>
   
  <body>
  <div class="box">
  <img src="img/DSC05940.JPG" />
  <div class="fontbox">
  <div class="font">1</div>
  <div class="font">2</div>
  <div class="font">3</div>
  <div class="font">4</div>
  </div>
   
  </div>
  </body>
  <script>
  $("img").animate({
  left: "-50px"
   
  }, 1000).animate({
  left: "-100px"
  }, 1000).animate({
  left: "-150px"
  }, 1000).animate({
  left: "-200px"
  },1000)
  $(".fontbox").animate({
  left:"-750px"
  },2000).animate({
  left:"-1500px"
  }).animate({
  left:"-2250"
  })
  </script>
   
  </html>

jquery视差图片切换

标签:blank   val   res   图片切换   no-repeat   bsp   set   文字   attr   

原文地址:http://www.cnblogs.com/fengyuzhen/p/7211943.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!