有一個鏈接,點擊某個鏈接,應打開新窗口, 用戶可以最小化該窗口,並點擊其他窗口應打開。所以會有多個窗口。如何打開每個點擊新窗口
有一個jQuery插件可以做同樣的事情,但其作品只能在Firefox中使用。不在Internet Explorer中。
有一個鏈接,點擊某個鏈接,應打開新窗口, 用戶可以最小化該窗口,並點擊其他窗口應打開。所以會有多個窗口。如何打開每個點擊新窗口
有一個jQuery插件可以做同樣的事情,但其作品只能在Firefox中使用。不在Internet Explorer中。
嘗試使用javascript函數window.open()。一爲使用參考的是在這裏:http://www.pageresource.com/jscript/jwinopen.htm
<a href="http://www.example.com/" target="_blank" />
怎麼了?
它在新標籤中打開,我想在新窗口。 – 2011-01-13 06:15:39
你還可以嘗試:
<script>
var i=1;
function openWin2(){
window.open("http://stackoverflow.com", "Win"+i++, 'location=0');
}
<script>
.....
<a href="javascript:openWin2()">Click to open window </a>
希望這有助於。
我使用鏈接的rel屬性。例如:
<a href="http://www.example.com/" rel="external" />
在jQuery中:
$('a[rel=external]').attr('target', '_blank');
順便說一句:請確保這真的是你想要做什麼。另請參閱http://stackoverflow.com/questions/118567/is-there-ever-a-good-reason-to-force-opening-a-new-browser-window – Daan 2011-01-11 11:22:35