网站:www.fineboon.com
html代码:
<div class="adv-content">
<div class="fullSlide">
<div class="kvbox">
<div class="kvcont" style="display: none;"><a><img src="img/01ss.jpg" alt="" class="bgie"></a></div>
<div class="kvcont" style="display: none;"><a><img src="img/02ss.jpg" alt="" class="bgie" ></a></div>
<div class="kvcont" style="display: none;"><a><img src="img/03ss.jpg" alt="" class="bgie"></a></div>
<div class="kvcont" style="display: none;"><a><img src="img/04ss.jpg" alt="" class="bgie"></a></div>
<div class="kvcont" style="display: block;"><a><img src="img/05ss.jpg" alt="" class="bgie"></a></div>
</div>
<div class="kvnav">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
<a href="#" class="kv_prev"></a>
<a href="#" class="kv_next"></a>
</div>
<div class="banlink">
<a href="javascript:void(0);" target="_blank">我们是如何做到</a>
<a href="https://fineboon.tmall.com" target="_blank">如何在线购买</a>
</div>
<!-- <a class="arrow-down-top" href="#page2"></a> -->
</div>
js代码:
$(document).ready(function($) {
//kv init
var _kvs = 0;
var _kvlen = $(".kvcont").length;
$(".kvcont").eq(0).show();
$(".kvnav a").eq(0).addClass("current");
$(".kvnav a").click(function(e){
e.preventDefault();
clearInterval(akv);
_kvs = $(this).index();
changekv();
akv = setInterval(resetindex,5000);
});
$(".kv_prev").click(function(e){
e.preventDefault();
clearInterval(akv);
_kvs--;
if(_kvs < 0 ){
_kvs = _kvlen-1;
}
changekv();
akv = setInterval(resetindex,5000);
});
$(".kv_next").click(function(e){
e.preventDefault();
clearInterval(akv);
_kvs++;
if(_kvs==_kvlen){
_kvs = 0;
}
changekv();
akv = setInterval(resetindex,5000);
});
function resetindex(){
_kvs++;
if(_kvs==_kvlen){
_kvs = 0;
}
changekv();
}
function changekv(){
$(".kvnav a").eq(_kvs).addClass("current").siblings().removeClass("current");
$(".kvcont").eq(_kvs).fadeIn(1000).siblings().fadeOut(1000);
var _index = parseInt(_kvs+1);
}
akv = setInterval(resetindex,5000);
$(window).resize(function(){
resizeKV();
});
resizeKV();
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…