1
這個腳本在windows機器上運行良好,並在前面顯示彈出窗口,但在mac機器彈出窗口中瀏覽器窗口後面。 我想在Mac機上始終顯示彈出窗口。窗口彈出在Mac機上
<script type="text/javascript">
var win=null;
$(document).ready(function() {
$("#buttonid").live("click",function(){
var alt = "http://www.testhost.com/test.php";
var rel = "http://www.testhost.com/test2.php";
var width= (window.innerWidth)-450;
var win = window.open(alt,"mywin","width=450,height="+window.innerHeight+",left="+width+", location=no, menubar=no, status=no, titlebar=no, scrollbars=no");
win.onload=function(){
window.location=rel;
}
if (window.focus) {
win.focus();
}
//setTimeout(win.focus(), 0);
return false;
});
});
</script>
</head>
<body>
<button id="buttonid">Click</button>
</body>
什麼是您使用的瀏覽器(S)在Windows和Mac? – MattDiamant 2013-03-12 06:36:40
windows:Firefox,chrome和mac:chrome,safari – 2013-03-12 06:41:11