Forum Moderators: mack
I want to create a pop up window for my site when a visitor clicks on a certain link. I have managed to find the code from another website and customized it to my needs (i.e. sizing).
Here is the code I have used:
<a href="#" onClick="window.open('helppage.htm', 'Save_Money', 'toolbar=no,resizable=no,scrollbars=yes,width=520,height=350,left=0,top=0');" title="Help Page" class="copylink">Click here if you require help with ordering</a></p>
Now the problem is:
I want to change the 'Save_Money' bit but everytime I do the pop up fails to work.
I also notice that the title for the pop up window is the title from another page in my site where i was testing it. I am clueless as to how to change the title for the pop up. Anyone?
Thanks in advance.
Tim
In your head section place the following code...
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=350');");
}
// End -->
</script>
Then where you want the link to occur use the following...
<A HREF="javascript:popUp('http://www.example.com')">link text here</A>
Mack.
I have a few different pop ups for different things, such as help page, discounts page, currency conversion, etc. These are different sizes.
So, rather than include a different bit in the head section for each one, can I use the size/scroll attributes in the body text? And if so, what is the syntax?
Thanks.
Tim
[webmasterworld.com...]
(The title is CUSTOM SIZE POPUP WINDOWS)