Cant pull attr data with javascript, coming back as undefined -
im using prettyphoto version 3.1.5 in prestashop site, , attempting add pinterest button, ideally not have change code in js file itself.
for reason media , url still coming undefined...
<script type="text/javascript"> $(document).ready(function() { {literal} var photo_options = { social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></' + 'script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_us&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowtransparency="true"></iframe></div><div class="pinterest"><a href="http://pinterest.com/pin/create/button/?url='+$(this).attr('href')+'&media='+$(this).attr('href')+'&description='+$(this).attr('title')+'" class="pin-it-button" count-layout="horizontal" target="_blank"><img border="0" src="http://assets.pinterest.com/images/pinext.png"; title="pin it" /></a></div>' }; {/literal} $("a[rel^='prettyphoto']").prettyphoto(photo_options); }); </script> here part of generated html after click on image...
<div id="pp_full_res"> <img id="fullresimage" src="/modules/gallery/img/2bf766b19efd5410fa795f452b401186.jpg" style="height: 365px; width: 486px;"> </div> i tried $('#fullresimage').attr('src') still nothing
Comments
Post a Comment