Flickr Badges Open New Window jQuery way

I recently added a Flickr Badge to a site and really loved everything about it except that there was no way to have it open the photos in a new window when they were clicked
Flickr badge looked like the following
– Username

<div id="flickr_badge_wrapper">
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gnecount=10&display=latest&size=s&layout=x&source=user&user=username"></script></div>

– Group

<div id="flickr_badge_wrapper">
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gnecount=10&display=latest&size=s&layout=x&source=group&group=group"></script>
</div>

The following script would loop back through all of the links within the div id “flickr_badge_wrapper” and change their “target” property to “_blank”. Add it to footer.php before

jQuery("#flickr_badge_wrapper a").attr("target","_blank");

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: