Monday, January 10, 2011

Open a web page URL in popup

Just now spent a lot of time searching for one solution. My requirement was to open a web page say www.google.com in a popup. That popup can be either thickbox, facebox, redbox or other similar popup box.

After some time of struggle, came across one solution which will definitely help in saving lots of other people effort. I did it with facebox and must admit, I didn't found it anywhere as simple enough to be directly implemented. It requires iframe along with facebox.


  1. Download and install facebox from  http://chriswanstrath.com/facebox/.
  2. For installing the facebox, lot of articles can be found, if you come across any issue, let me know.
  3. Place the below code where you want to render the site:
<div>
  <div id="interactive_ad" style="display:none">
    <iframe height="500" width="800" src="www.google.com"></iframe>
  </div>
  <a href="#interactive_ad_1" rel="[facebox]">interactivea_ad</a>
</div>

And thats it. Now when you will click on "interactivea_ad" link, it will open a facebox popup and will display the site in popup.

    No comments:

    Post a Comment