Pop Up Link Question

liunx

Guest
How can I create a link where it will pop up another window, smaller then normal with like rules or something in it.<!--content-->When you say rules, do you mean rulers as in cm and inches or something else.<br />
<br />
Well if you do mean a ruler then you'll possibly need a couple of images to run down the sides and along the top.<br />
<br />
<br />
To open a pop-up from a pop-up you can do this:<br />
<br />
new_win = window.open(blah blah blah, all the usual stuff)<br />
<br />
new_win.document.write('<script type="text/javascript"><!--');<br />
<br />
new_win.document.write('function another_new_win(){')<br />
new_win.document.write('new_win_2 = window.open(blah blah blah, all the usual stuff);}');<br />
<br />
new_win.document.write('<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="another_new_win();return false;">');<!--content-->Im sorry I typed that quickly, this is what I mean. Sometimes when you go to a website on the bottom it will have a link set that says somethign like, <br />
<br />
contact us | rules | email | terms<br />
<br />
now when you click on those, it open in a window like 400x200, and this is one of there htmls. The problem Im having is I want to create something like that, but I dont know the code. Does anyone?<!--content-->function the_rules(){<br />
<br />
rules = window.open("", "rules", "toolbar=no,status=no,width=400,height=200");<br />
rules.document.write("<html><head><title>Rules</title></head><body><p>");<br />
rules.document.write('Here are some rules:<br><ol>');<br />
rules.document.write('<li>I am always right.</li>');<br />
rules.document.write('<li>If I am wrong, see rule 1.</li></ol>');<br />
rules.document.write("</p></body></html>");}<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="the_rules();return false;">View The Rules</a><!--content-->Ok, lol. Not necessarily rules. Lets just say I have 4 links that each of them are going to a seprate window. I got your script but you need to re-direct me in a easier way.<!--content-->OK, I think I get you now, you mean that you've already made the pages and you want to open them in a pop-up. If so do this:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick='window.open("rules.html", "", "toolbar=no,status=no,width=400,height=200");return false;'>View The Rules</a><!--content-->BANG! on the money! your the man<!--content-->*lets out a sigh of relief.<br />
<br />
Thank God I got it (even if it was later rather than sooner).<br />
<br />
Happy to help:)<!--content-->Originally posted by lavalamp <br />
OK, I think I get you now, you mean that you've already made the pages and you want to open them in a pop-up. If so do this:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick='window.open("rules.html", "", "toolbar=no,status=no,width=400,height=200");return false;'>View The Rules</a> Here we go again. That will give you a link that does absolutely nothing for the 13% of people who do not use JavaScript. This is bad. And as that 13% includes some good people who cannot use JavaScript because of some disability it is very bad. Use instead:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"rules.html" onclick='window.open("this.href", "", "width=400,height=200");return false;'>View The Rules</a><!--content-->
 
Back
Top