js实例教程-基于jquery的网站幻灯片切换效果焦点图代码

发布时间:2018-12-08 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了js实例教程-基于jquery的网站幻灯片切换效果焦点图代码脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

导入jquery代码

. 代码如下:


<script src="https://libs.baidu.COM/jquery/1.9.1/jquery.min.js" tyPE="text/javascript"></script>
&nbsp;<script src="js/jquery-image-scale-carousel.js" type="text/javascript" charset="utf-8"></script>
 <script>
  VAR carousel_images = [
   "images/01.jpg",
   "images/02.jpg",
   "images/03.jpg",
   "images/04.jpg",
   "images/05.jpg",
   "images/06.jpg",
   "images/07.jpg"
  ];

  // Example wIThout autoplay
  $(window).load(function() {
   $("#photo_container").isc({
    imgArray: carousel_images
   });
  });

  // Example with autoplay
  /* $(window).load(function() {
   $("#photo_container").isc({
    imgArray: carousel_images,
    autoplay: true,
    autoplayTimer: 5000 // 5 seconds.
   });
  }); */
 </script>

 

 


样式文件css有几个 需要加载个

 

 

. 代码如下:


body {
 font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,sans-serif;
 color: #FFF;
 font-Size: 12px;
 background: #000;
}

 

h1 {
 font-size: 52px;
 text-align: @R_126_934@;
}

h1,h2,h3,h4 {
 font-weight: 100;
}

#photo_container {
 width: 960px;
 height: 400px;
 ;margin: auto;
 background-color: #000;
}

p {
 text-align: center;
}

/*定义文字样式*/
A {FONT-SIZE: 12px; COLOR: #000;}
A:link {COLOR: #2d8931; TEXT-DECORATION: none;}
A:visited {COLOR: #333; TEXT-DECORATION: none;}
A:hover {COLOR: #333; TEXT-DECORATION:underline;}
A:active {COLOR: #333; TEXT-DECORATION: none;}


#swipe_nav_prev,#swipe_nav_next {
 position: absolute;
 top: 0;
 left: 0;
 z-index: 2000;
 background-color: #ccc;
 cursor: pointer;
 text-align: center;
 display: none;
}

#swipe_nav_PRev {
 background: #333 url('prev.png') no-repeat center center;

}

#swipe_nav_next {
 background: #333 url('next.png') no-repeat center center;

}

.internal_swipe_container {
 position: relative;
}

.trans {
 filter:alpha(opacity=75);
 -moz-opacity:0.75;
 -khtML-opacity: 0.75;
 opacity: 0.75;
}

.jq_swipe_image {
 background: url('loader.gif') no-repeat center center;

}

#count_container {
 padding: 0;
 margin: 0;
 position: absolute;
 top: 0;
 left: 0;
 background-color: pink;
 height: 6px;
 list-style: none;
}

.counter {
 float: left;
 height: 6px;
 background-color: #FFF;
 z-index: 200;
 height: 6px;
 padding: 0;
 margin: 0;
}

.counter:hover {
 cursor: pointer;
 background-color: #ff00fc !important;
}

.current {
 background-color: #ff00fc !important;
}


导入jquery代码

. 代码如下:


<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
 <script src="js/jquery-image-scale-carousel.js" type="text/javascript" charset="utf-8"></script>
 <script>
  var carousel_images = [
   "images/01.jpg",
   "images/02.jpg",
   "images/03.jpg",
   "images/04.jpg",
   "images/05.jpg",
   "images/06.jpg",
   "images/07.jpg"
  ];

  // Example without autoplay
  $(window).load(function() {
   $("#photo_container").isc({
    imgArray: carousel_images
   });
  });

  // Example with autoplay
  /* $(window).load(function() {
   $("#photo_container").isc({
    imgArray: carousel_images,
    autoplay: true,
    autoplayTimer: 5000 // 5 seconds.
   });
  }); */
 </script>

 

 


样式文件css有几个 需要加载个

 

 

. 代码如下:


body {
 font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,sans-serif;
 color: #FFF;
 font-size: 12px;
 background: #000;
}

 

h1 {
 font-size: 52px;
 text-align: center;
}

h1,h2,h3,h4 {
 font-weight: 100;
}

#photo_container {
 width: 960px;
 height: 400px;
 margin: auto;
 background-color: #000;
}

p {
 text-align: center;
}

/*定义文字样式*/
A {FONT-SIZE: 12px; COLOR: #000;}
A:link {COLOR: #2d8931; TEXT-DECORATION: none;}
A:visited {COLOR: #333; TEXT-DECORATION: none;}
A:hover {COLOR: #333; TEXT-DECORATION:underline;}
A:active {COLOR: #333; TEXT-DECORATION: none;}


#swipe_nav_prev,#swipe_nav_next {
 position: absolute;
 top: 0;
 left: 0;
 z-index: 2000;
 background-color: #ccc;
 cursor: pointer;
 text-align: center;
 display: none;
}

#swipe_nav_prev {
 background: #333 url('prev.png') no-repeat center center;

}

#swipe_nav_next {
 background: #333 url('next.png') no-repeat center center;

}

.internal_swipe_container {
 position: relative;
}

.trans {
 filter:alpha(opacity=75);
 -moz-opacity:0.75;
 -khtml-opacity: 0.75;
 opacity: 0.75;
}

.jq_swipe_image {
 background: url('loader.gif') no-repeat center center;

}

#count_container {
 padding: 0;
 margin: 0;
 position: absolute;
 top: 0;
 left: 0;
 background-color: pink;
 height: 6px;
 list-style: none;
}

.counter {
 float: left;
 height: 6px;
 background-color: #FFF;
 z-index: 200;
 height: 6px;
 padding: 0;
 margin: 0;
}

.counter:hover {
 cursor: pointer;
 background-color: #ff00fc !important;
}

.current {
 background-color: #ff00fc !important;
}


觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!

脚本宝典总结

以上是脚本宝典为你收集整理的js实例教程-基于jquery的网站幻灯片切换效果焦点图代码全部内容,希望文章能够帮你解决js实例教程-基于jquery的网站幻灯片切换效果焦点图代码所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。