...

View Full Version : popup via link



alrukus
02-10-2004, 01:47 AM
hey how do i popup a window when a user clicks a link? like how can i make a link open up in a new popup window. kinda like a popup ad where i can set the variables like size and stuff but it opens when they click a link? thanks so much...

glenngv
02-10-2004, 04:04 AM
function pop(url, target){
var w = window.open(url, target, 'width=800,height=400,resizable=1');
w.focus();
return false;
}


HTML:
<a href="page.htm" target="popup1" onclick="return pop(this.href, this.target)">Popup 1</a>
<a href="page2.htm" target="popup2" onclick="return pop(this.href, this.target)">Popup 2</a>

For more details of the window features, go here (http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum