Pro/public/static/online/js/dt-play.js
2026-02-25 01:50:31 +08:00

78 lines
1.8 KiB
JavaScript

var CanvasConfig={
"resizeid":"#table-box",
"Tab_num":30,
"tab_a_rows":13,
"tab_a_cols":6,
"tab_b_rows":34,
}
$(function(){
var table_id = parseInt($('#table_id').val());
if(table_id > 0){
var query = new Object();
query.table_id = table_id;
$.ajax({
url:'/dt/get_wb',
data:query,
dataType:"json",
type:"POST",
success:function(data){
if(data.code == 1){
var ludan = data.data;
if(ludan){
resizeCanvas("#single",CanvasConfig,ludan);
resize();
}else{
resizeCanvas("#single",CanvasConfig);
resize();
}
}
}
});
}else{
alert('获取桌子数据错误');
window.location.href="/index/index";
}
$("#clear-btn").click(function(){
$.removeData(down_bet)
alldown=0
$(".play.start .brand-table .bet_box").find("i").remove();
$("#down_bet").find("td").html("0");
})
})
$(window).resize(function(){
resize();
});
$(function(){
var num = $('.affiche-box').find('li').length;
if(num > 1){
var time=setInterval('animate(".affiche-box")',3000);
}
var $spanid=$(".play .table-info .btn-box span")
$spanid.click(function(){
$(this).addClass("on").siblings("span").removeClass("on")
var nav=$(this).index();
$(".play .table-info ul").eq(nav).show(300).siblings("ul").hide();
})
});
// 自适应
function resize(){
var liheight=($("#single").height()-7)/6
$(".play .foot-box .count ul li").height(liheight+0.5)
$(".play .foot-box .timer-box tr").height(liheight+1)
// console.log(liheight*6+7)
}
// 无缝滚动公告
function animate(opj){
$(opj).find('ul').animate({
marginTop : "-75px"
},800,function(){
$(this).css({marginTop : "0"}).find("li:first").appendTo(this);
})
}