javascript - prettyphoto wont load when writing href using document.write -



javascript - prettyphoto wont load when writing href using document.write -

i have codes this

<span id="$rsc" class="menu" title="action menu" onclick="menu(\''.$rsc.'\')">click</span> function menu(id){ var d = document.getelementbyid(id); d.innerhtml ='<a href="somthing;iframe=true&amp;width=400&amp;height=170" rel="prettyphoto[iframe]" >doesnt work</a>'; } <script type="text/javascript" charset="utf-8"> jquery.noconflict(); jquery(document).ready(function($) { $(".pp_pic_holder").remove(); $(".pp_overlay").remove(); $(".ppt").remove(); $(".gallery a[rel^='prettyphoto']").prettyphoto({theme:'h0mayun'}); }); </script>

the problem after clicking on "click" , writing html link prettyphoto plugin doesn't load

any help appreciated.

edit------------------- damn conflict 1 time again jquery conflict got work alter function this:

<script type="text/javascript" charset="utf-8"> jquery.noconflict(); jquery(document).ready(function($) { $(".pp_pic_holder").remove(); $(".pp_overlay").remove(); $(".ppt").remove(); $(".gallery a[rel^='prettyphoto']").prettyphoto({theme:'h0mayun'}); }); </script> function menu(id){ var d = document.getelementbyid(id); d.innerhtml ='<a href="somthing;iframe=true&amp;width=400&amp;height=170" rel="prettyphoto[iframe]" >doesnt work</a>'; jquery.noconflict(); jquery(document).ready(function($) { $(".pp_pic_holder").remove(); $(".pp_overlay").remove(); $(".ppt").remove(); $(".gallery a[rel^='prettyphoto']").prettyphoto({theme:'h0mayun'}); }); }

and not going work way. initialize prettyphoto existing elements on page after page loaded. when insert new element, prettyphoto plugin knows nil it, because "attached" elements existed before. have initialize prettyphoto after changes on page or attach after changes updated elements. this

function menu(id){ var d = document.getelementbyid(id); d.innerhtml ='<a href="somthing;iframe=true&amp;width=400&amp;height=170" rel="prettyphoto[iframe]" >doesnt work</a>'; $('a', d).prettyphoto({theme:'h0mayun'}); }

ps: i've made simple test illustration of prettyphoto , working

function menu(id){ var d = document.getelementbyid(id); d.innerhtml ='<a href="images/fullscreen/3.jpg" rel="prettyphoto[gallery1]">test link</a>'; $('a', d).prettyphoto(); }

javascript jquery prettyphoto

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -