<div id="js_banner" class="js_banner">
<ul id="js_banner_img" class="js_banner_img clearfix">
<li>
<a href="promotions.html#promotions02" style="background:url('/images/index/banner-1.png') no-repeat center;"></a>
</li>
<li>
<a href="slotgame.html" style="background:url('/images/index/banner-2.png') no-repeat center;"></a>
</li>
<li>
<a href="slotgame.html" style="background:url('/images/index/banner-3.png') no-repeat center;"></a>
</li>
<li>
<a href="promotions.html#promotions09" target="_blank" style="background:url('/images/index/banner-4.png') no-repeat center;"></a>
</li>
<li>
<a href="promotions.html#promotions09" target="_blank" style="background:url('/images/index/banner-5.png') no-repeat center;"></a>
</li>
<li>
<a href="promotions.html#promotions09" target="_blank" style="background:url('/images/index/banner-6.png') no-repeat center;"></a>
</li>
</ul>
<div class="js_banner_common">
<a id="js_banner_prev" href="javascript:void(0);" class="js_banner_prev"></a>
<a id="js_banner_next" href="javascript:void(0);" class="js_banner_next"></a>
</div>
</div>
</div>
脚本:
/*
CreatDate: 2014-08-03 02:15:33
Discription: Index JS
Author: Turbo
*/
var depositShow = true,
takeShow = true,
bankShow = true;
$(function(){
//slider
var $window = $(window),window_width = $window.width();
//$('#js_banner, #js_banner_img li').width(1920);
$(".js_banner_img a").width(window_width);
$(window).on("resize",function(){
$(".js_banner_img a").width($(window).width());
})
new $.Tab({
target: $('#js_banner_img li'),
effect: 'base',
animateTime: 1000,
stay: 4000,
autoPlay: true,
merge: true,
prevBtn: $('#js_banner_prev'),
nextBtn: $('#js_banner_next')
});
//flash
$(".flash").flashPlay({
autoPlay:true,
during:4000
});
//notice
autoNotice = setInterval(function(){runNotice();},10);
$(".notice_con").mouseenter(function(){
clearInterval(autoNotice);
});
$(".notice_con").mouseleave(function(){
autoNotice = setInterval(function(){runNotice();},10);
});
$(".notice_con a").click(function(){
openWindow("boardhistory.html","boardhistory",800,620,"","");
});
//siblings
$(".siblings .s_title").mouseover(function(){
$(this).parents("li").addClass("down cur");
$(this).parents("li").siblings(".siblings ul li").removeClass("down cur");
$(".siblings li:not(.cur) img").hide();
$(".cur img").fadeIn(300);
});
//rate_num_show
$("#deposit_s").scroll(function () {
setNumber("deposit","s");
});
$("#take_s").scroll(function () {
setNumber("take","m");
});
$("#bank_s").scroll(function () {
setNumber("bank","s");
});
$(window).scroll(function () {
scrollOn();
});
scrollOn();
});
var noticeCur = 0;
function runNotice(){
var noticeArr = $(".notice_con a"), noticeLen = noticeArr.length;
if(noticeLen > 0){
$(noticeArr[noticeCur]).css({"margin-left":"-=1px","display":"inline-block"});
curMargin = parseInt(($(noticeArr[noticeCur]).css("margin-left").replace("px","")),10);
curWidth = $(noticeArr[noticeCur]).width();
if(curWidth + curMargin == 0){
$(noticeArr[noticeCur]).css({"margin-left":"900px","display":"none"});
noticeCur = (noticeCur == (noticeLen-1) ? 0 : (noticeCur+1));
}
}
else{
clearInterval(autoNotice);
}
}
function setRate(id,maxNum,value,time,easing){
var rate = Math.round(value*1000/maxNum)/10;
rate = rate-100;
if(rate > 0){rate = 0;}
if(id != "bank"){
$("#"+id).animate({"left":rate+"%"},time,easing,function(){});
}
$("#"+id+"_s").animate({scrollTop: value},time,easing,function(){});
}
function setNumber(id,type){
var value;
if(type == "s"){
value = $("#"+id+"_s").scrollTop();
value = Math.round(value);
}else if(type == "m"){
var temp = $("#"+id+"_s").scrollTop();
temp = Math.round(temp);
value = Math.floor(temp/60)+"'";
if(temp%60 < 10){
value += "0"+(temp%60);
} else{
value += (temp%60);
}
}
$("#"+id+"_num").html(value);
}
function scrollOn(){
var showPosition = $(window).height() + $(window).scrollTop();
if(showPosition > 1000 && depositShow){
depositShow = false;
setRate("deposit",90,27,2000,"easeOutCirc");
}
if(showPosition > 1100 && takeShow){
takeShow = false;
setRate("take",240,155,2000,"easeOutCirc");
}
if(showPosition > 1200 && bankShow){
bankShow = false;
setRate("bank",90,28,2000,"easeOutSine");
}
}