jQuery Cleanly Open Links in Popup Windows

Sam Deering

Simple jQuery code snippet to add an event to all links with class .popup to open in a popup window instead of the current page or new tab/window. Specify the heights and widths as you please.

jQuery(document).ready(function($) {
	jQuery('a.popup').live('click', function(){
		if (window.focus) {newwindow.focus()}
		return false;