用css样式和脚本js结合打开链接

来源:互联网 发布:mac文件拷贝到硬盘 编辑:程序博客网 时间:2024/04/28 01:24
//open window
function openWindow(openUrl, openName, openWidth, openHeight, openLeft, openTop){
var url = openUrl;
var name = openName;
var width = openWidth;
var height = openHeight;
var left = (String(openLeft) == "" ? (window.screen.availWidth-10-openWidth)/2 : openLeft);
var top = (String(openTop) == "" ? (window.screen.availHeight-40-openHeight)/2 : openTop);
window.open(url, name, "depended=yes,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);

}


//open game

$(".open_opus, .open_pt, .open_sport, .open_keno, .open_slotgame").click(function(event){
//To determine whether the download
var obj = event.srcElement ? event.srcElement : event.target;
if(!$(obj).attr("down_type")) {
//To determine whether the login
//It's the test value, please obtain the conditions of AJAX function, and then delete this line 

open_type = $(this).attr("open_type");
switch(open_type){
case "pt":
if(checkGameState(2) && checkLogin()){
openWindow('/html/PTPage.html?gamecode=7bal', 'onlinept',1280,650,"",0);
}
break;
case "sport":
if(checkGameState(3)){
window.location.href="/html/sportbet.html";
}
break;
case "keno":
if(checkGameState(4) && checkLogin()){
openWindow("http://keno.gi899.com","onlinekeno",1280,650,"",0);
}
break;
case "slotgame":
if(checkGameState(2) && checkLogin()){
window.location.href="/html/slotgame.html";
}
break;
default:
return;
}


}
});
0 0
原创粉丝点击