jquery open link new window


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



Copy this code and paste it in your HTML
  1. function external_links (selector) {
  2. var selector = $(selector);
  3. selector.attr('title', 'opens in a new window');
  4. selector.each(function(){
  5. $(this).click(function(){
  6. var url = $(this).attr('href');
  7. window.open(url,'_blank','height=640,width=1040', false);
  8. return false;
  9. });
  10. });
  11. }
  12.  
  13. external_links('#nav ul li a');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.