How to Make Flickr Badges Open New Window

I am using the wordpress as framework.
In the PHP code i have used the flickr api to access the images from the flickr.
So i need to open in the new window when i clicked on a particular image.

Does anybody have any idea about doing it through the api.Something like passing the parameter like “target=’_blank’”
OR
Should we have to write the custom method for it in javascript.

Read More

Ideas are most welcome!!
Thank u.

Related posts

Leave a Reply

1 comment

  1. I don’t think it can be done using the API, but it’s quite easy to do with Javascript.

    I grabbed some code from the Flickr badge creator for reference:

    <!-- Start of Flickr Badge -->
    <style type="text/css">
    #flickr_badge_source_txt {padding:0; font: 11px Arial, Helvetica, Sans serif; color:#666666;}
    #flickr_badge_icon {display:block !important; margin:0 !important; border: 1px solid rgb(0, 0, 0) !important;}
    #flickr_icon_td {padding:0 5px 0 0 !important;}
    .flickr_badge_image {text-align:center !important;}
    .flickr_badge_image img {border: 1px solid black !important;}
    #flickr_badge_uber_wrapper {width:150px;}
    #flickr_www {display:block; text-align:center; padding:0 10px 0 10px !important; font: 11px Arial, Helvetica, Sans serif !important; color:#3993ff !important;}
    #flickr_badge_uber_wrapper a:hover,
    #flickr_badge_uber_wrapper a:link,
    #flickr_badge_uber_wrapper a:active,
    #flickr_badge_uber_wrapper a:visited {text-decoration:none !important; background:inherit !important;color:#3993ff;}
    #flickr_badge_wrapper {background-color:#ffffff;border: solid 1px #000000}
    #flickr_badge_source {padding:0 !important; font: 11px Arial, Helvetica, Sans serif !important; color:#666666 !important;}
    </style>
    <table id="flickr_badge_uber_wrapper" cellpadding="0" cellspacing="10" border="0"><tr><td><a href="http://www.flickr.com" id="flickr_www">www.<strong style="color:#3993ff">flick<span style="color:#ff1c92">r</span></strong>.com</a><table cellpadding="0" cellspacing="10" border="0" id="flickr_badge_wrapper">
    <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?show_name=1&count=3&display=latest&size=t&layout=v&source=all_tag&tag=stack+overflow&user=95384268%40N00"></script>
    <tr>
    <td id="flickr_badge_source" valign="center" align="center">
    <table cellpadding="0" cellspacing="0" border="0"><tr>
    <td id="flickr_badge_source_txt">More <a href="http://www.flickr.com/photos/tags/stack overflow/">photos or video tagged with stack overflow</a> on Flickr</td>
    </tr></table>
    </td>
    </tr>
    </table>
    </td></tr></table>
    <!-- End of Flickr Badge -->
    

    With jQuery then, it’s just a matter of targetting the links within the Flickr badge and adding the target=_blank attribute:

    $(document).ready(function(){
     $("#flickr_badge_uber_wrapper a").attr('target','_blank');
    });