Skip to content

Instantly share code, notes, and snippets.

@nucreativa
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucreativa/0f2b3c044d1580aa8a61 to your computer and use it in GitHub Desktop.
Save nucreativa/0f2b3c044d1580aa8a61 to your computer and use it in GitHub Desktop.
How to open page in new window
// You only need to add class "open-new-window" on link that you want to open in new window
// Function for open link in new browser window
$("a.open-new-window")
.on('click', function () {
var url = $(this).attr('href'),
conf = "height=" + (window.screen.height * 0.9) + ",width=" + (window.screen.width * 0.9);
window.open(url, 'New Window', conf);
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment