$(function(){
//首页大图
$("#wwtjul li").mouseover( function()
{
var poper=$(".f_poper",$(this ));
var img=$(this ).children("img");
poper.show().stop( true ).animate({ top : -120, height: 118 }, 250 );
img.stop( true ).animate({ top : -118 }, 250 );
}).mouseleave( function()
{
var poper=$(".f_poper",$(this ));
var img=$(this ).children("img");
poper.show().stop( true ).animate({ top : -2, height: 0 }, 250, function(){ $( this ).hide(); } )
img.stop( true ).animate({ top : 0 }, 250 );
})
//新游戏排行
$(".b4-xglist-box li").each(function(){
$(this).hover(function(){
$(".b4-xglist-box li").eq(0).children("p").css("display","block");
$(".b4-xglist-box li").eq(0).children("div").css("display","none");
$(this).children("p").css("display","none");
$(this).children('div').css("display","block");
},
function(){
$(this).children('p').css("display","block");
$(this).children('div').css("display","none");
$(".b4-xglist-box li").eq(0).children("p").css("display","none");
$(".b4-xglist-box li").eq(0).children("div").css("display","block");
})
})
//微信二维码
$(".logo_right p").hover(function () {
$(".logo_right p em").show();
}, function () {
$(".logo_right p em").hide();
})
//首页顶部切换
$(document).ready(function () {
$('.tab_menu_l p').mouseover(function () {
var data = $(this).attr("data");
$('.tab_menu_l p').removeClass("hover");
$(this).addClass("hover");
$('.tab_menu_r').css("display", "none");
$('.tab_menu_r').eq(data).css("display", "block");
})
})
$(".game_com_list").each(function() {
var line = $(this).find(".line");
$(this).find("li").each(function(i) {
$(this).hover(function() {
$(this).siblings().removeClass("on");
$(this).addClass("on");
line.stop(true, false).animate({
"left": $(this).position().left + 0 + 'px'
},
500)
});
});
})
//卡塔尔世界杯bob综合体育全站页二维码弹出
$(function () {
$('.apkbtn').hover(function () {
$('.apkbtn2').show();
}, function () {
$('.apkbtn2').hide();
});
$('.iosbtn').hover(function () {
$('.iosbtn2').show();
}, function () {
$('.iosbtn2').hide();
});
$('.libaobtn').hover(function () {
$('.libaobtn2').show();
}, function () {
$('.libaobtn2').hide();
});
$('.dnbtn').hover(function () {
$('.dnbtn2').show();
}, function () {
$('.dnbtn2').hide();
})
$('.news_tab li').hover(function(){
var index = $(this).index();
$(this).addClass('hover').siblings('li').removeClass('hover');
$('.subject_list dl').eq(index).show().siblings('.subject_list dl').hide();
})
})
})
//首页幻灯片
$(function() { (function($) {
$.fn.Slide = function(options) {
var defaults = {
item: "slide-item",
nav: "slide-nav",
nowClass: "nownav",
loading: "slide-loading"
},
options = options || {};
options = $.extend(defaults, options);
var cont = $(this),
item = cont.find("." + options.item),
nav = cont.find("." + options.nav),
curr = options.nowClass,
len = item.length,
width = item.width(),
html = "",
index = order = 0,
timer = null,
lw = "-" + width + "px",
rw = width + "px",
newtimer,
ld = cont.find("." + options.loading);
item.each(function(i) {
$(this).css({
left: i === index ? 0 : (i > index ? width + 'px': '-' + width + 'px')
});
html += '' + (i + 1) + '';
});
nav.html(html);
var navitem = nav.find("a");
navitem.eq(index).addClass(curr);
function anim(index, dir) {
loading();
if (order === len - 1 && dir === 'next') {
item.eq(order).stop(true, false).animate({
left: lw
});
item.eq(index).css({
left: rw
}).stop(true, false).animate({
left: 0
});
} else if (order === 0 && dir === 'prev') {
item.eq(0).stop(true, false).animate({
left: rw
});
item.eq(index).css({
left: lw
}).stop(true, false).animate({
left: 0
});
} else {
item.eq(order).stop(true, false).animate({
left: index > order ? lw: rw
});
item.eq(index).stop(true, false).css({
left: index > order ? rw: lw
}).animate({
left: 0
});
}
order = index;
navitem.removeClass(curr).eq(index).addClass(curr);
}
function next() {
index = order >= len - 1 ? 0 : order + 1;
_stop();
ld.stop(true, true).animate({
"width": 0
},
0);
anim(index, 'next');
timer = setInterval(next, 5000);
}
function prev() {
index = order <= 0 ? len - 1 : order - 1;
_stop();
ld.stop(true, true).animate({
"width": 0
},
0);
anim(index, 'prev');
timer = setInterval(next, 5000);
}
function auto() {
loading();
timer = setInterval(next, 5000);
}
function _stop() {
clearInterval(timer);
}
function loading() {
ld.css({
"height": "0",
"height": "5px",
"position": "absolute",
"left": "0",
"bottom": "0",
"background": "#ffe825",
"z-index": "10"
});
ld.animate({
"width": "100%"
},
5000).animate({
"width": 0
},
0);
}
return this.each(function() {
auto();
navitem.hover(function() {
_stop();
var i = navitem.index(this);
if (/nownav/.test($(this).attr('class'))) {
return false;
}
if (newtimer) clearTimeout(newtimer);
newtimer = setTimeout(function() {
_stop();
ld.stop(true, true).animate({
"width": 0
},
0);
anim(i, this);
},
250);
},
auto);
$('#next').on('click', next);
$('#prev').on('click', prev);
});
};
})(jQuery);
$("#slide").Slide();
})
//游戏福利介绍 收起 展开
$(function(){
var slideHeight = 200; // px
var defHeight = $('#tbsm').height();
if(defHeight >= slideHeight){
$('#tbsm').css('height' , slideHeight + 'px');
$('#read-morex').append('展开全部福利介绍');
$('#read-morex a').click(function(){
var curHeight = $('#tbsm').height();
if(curHeight == slideHeight){
$('#tbsm').animate({
height: defHeight
}, "normal");
$('#read-morex a').html('收起福利介绍');
$('#gradient').fadeOut();
}else{
$('#tbsm').animate({
height: slideHeight
}, "normal");
$('#read-morex a').html('展开全部福利介绍');
$('#gradient').fadeIn();
}
return false;
});
}
});
//热门礼包
$(function(){
$('ul.toplist').each(function(ind, ele) {
$(this).find('li:first').addClass('hover');
$(this).find('li:last').css('border-bottom-width', 0);
$(this).find('li').mouseover(function() {
$(ele).find('li').removeClass('hover');
$(this).addClass('hover')
})
});
})
//领号
$(function(){
$('ul.toplist').each(function(ind, ele) {
$(this).find('li:first').addClass('hover');
$(this).find('li:last').css('border-bottom-width', 0);
$(this).find('li').mouseover(function() {
$(ele).find('li').removeClass('hover');
$(this).addClass('hover')
})
});
})
function get_gift_code(gameId, modelid){
$.post('/api.php?op=gift_code',{id:gameId,modelid:modelid}, function(d){
if(d.status){
$('.gift-code input').val(d.code);
$('.gift-code').fadeIn();
}else{
alert(d.msg);
}
},'json');
}
$(document).ready(function () {
//卡塔尔世界杯bob综合体育全站页排行榜
$("#remenpaihang .item:first").find(".big_ph").css("display", "block");
$("#remenpaihang .item:first").find(".small_ph").css("display", "none");
$("#remenpaihang .item:first").addClass("item_big");
$("#remenpaihang1 .item:first").find(".big_ph").css("display", "block");
$("#remenpaihang1 .item:first").find(".small_ph").css("display", "none");
$("#remenpaihang1 .item:first").addClass("item_big");
$("#remenpaihang .item").hover(
function () {
$(this).siblings().find(".small_ph").css("display", "block");
$(this).siblings().find(".big_ph").css("display", "none");
$(this).parent().find(".item").removeClass("item_big");
$(this).find(".small_ph").css("display", "none");
$(this).find(".big_ph ").css("display", "block");
$(this).addClass("item_big");
}
);
$("#remenpaihang1 .item").hover(
function () {
$(this).siblings().find(".small_ph").css("display", "block");
$(this).siblings().find(".big_ph").css("display", "none");
$(this).parent().find(".item").removeClass("item_big");
$(this).find(".small_ph").css("display", "none");
$(this).find(".big_ph ").css("display", "block");
$(this).addClass("item_big");
}
);
//弹出教程
$(".btn-help").click(function(){
window.open('/ioshelp.html','newWindow','width=400,height=590');
}
);
$("#open-newWindow").click(function(){
$url=$(this).attr("data-url");
window.open($url,'newWindow','width=640,height=360');
}
);
});
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]); return null;
}