Tutorials » Javascript » Adding Pop-ups




Step 1

Find the <head> tag in your html coding of the page where you want the link to show up (i.e. if you wanted the pop-up on the site page, find the site page's <head> tag). Once you've found it, place this code between the </script> and </head> tags:


Select All

Step 2

You can mess around with it, but if you don't know what goes where, you'll need to listen up. If you want scrollbars, just change scrollbars=0 to scrollbars=1. I would leave location, resizeable, menubar, titlebar and toolbar alone, but if you want a status bar, you can switch that to 1. Change the width and height to however big you want your pop-up window (small is 200, large is 800).

Replace KEYWORD with a memorable key word. For example, if your page was about LJ icons, you could replace KEYWORD with 'ljicons'. It is very important to remember to replace both KEYWORDs or the script will not work! You also need to replace "http://yourpage.com/page1.html" with the website page's URL that you want in your pop-up window.

Step 3

Replace the link code (<a href="http://yourpage.com/page1.html">link</a>) in the <body> tag, wherever you want the link to be, with this code:



All you have to do now is remember to replace every KEYWORD portion with the exact same key word. After that, you have your very own pop-up window!







 
 

All content copyright their respective owners. No copyright infringement is intended, and no money is being made.