Clean way to open popup windows


/ Published in: jQuery
Save to your folder(s)

Here is a nice snippet to open links in pop-up windows. Just add the popup css class to your link to make it work.


Copy this code and paste it in your HTML
  1. jQuery('a.popup').live('click', function(){
  2. newwindow=window.open($(this).attr('href'),'','height=200,width=150');
  3. if (window.focus) {newwindow.focus()}
  4. return false;
  5. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.