jquery-socialist icon indicating copy to clipboard operation
jquery-socialist copied to clipboard

Open links in new window

Open sakroy opened this issue 13 years ago • 3 comments

Hi,

Can you modify the script so that links open in a new window?

I tried adding Target Blank but it doesn't work.

var $headDiv = $('

'), $source = $('
'), $sourceLnk = $('<a href="'+itemObj.img.href+'" title="'+itemObj.link.title+' TARGET="_blank">'), $sourceLnkDiv = $('
'), $apiSpan = $('
'), $apiSpanLnk = $('<a href="'+itemObj.img.href+' TARGET="_blank">'), $contentDiv = $('
'), $contentDivInner = $('
'+itemObj.txt+'
'), $imgLnk = $('<a href="'+itemObj.img.href+'" title="'+itemObj.link.title+' TARGET="_blank">'), $img = $(''+helpers.stripHtml(itemObj.img.alt)+''), $shareDiv = $(''), $dateSpan = $('
'), $footDiv = $('
');

Thanks.

sakroy avatar Aug 27 '12 02:08 sakroy

I'm not sure that "opening target links in new window" would always be the desired behavior. I will investigate adding an option for this.

iatek avatar Sep 06 '12 12:09 iatek

Yeh, I wouldn advise against changing this. Leave it up to the user to decide where they want links opened, don't try to force it. CMD/CTRL clicking is not difficult.

jamesabruce avatar Sep 10 '12 08:09 jamesabruce

I Would like this to be an optional function though as my links cant open in the same window :-1:

Strydom avatar Dec 27 '12 16:12 Strydom