Clean way to open popup windows in jQuery
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Although their popularity decreased with the rise of popup blockers, pop-up windows can still be useful in some particular cases. 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.

jQuery('a.popup').live('click', function(){
	newwindow=window.open($(this).attr('href'),'','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
});

Source

You may want to check :

  1. center element on screen
  2. Open External Links In New Window
  3. center an element on screen
  4. force links to open in a new tab
  5. Styling Your WordPress Comments

Post a Comment

Your email is never shared. Required fields are marked *

*
*