I am using shadowbox.js for image gallery performance.
For this we need to generate HTML
& lt; A href = "picture / Ganesh 3602.jpg" rel = "shadowbox [my]" & gt; & Lt; Img src = "image / thumb.jpg" alt = "first" title = "first image" /> & Lt; / A & gt; & Lt; A href = "picture / original.jpg" rel = "shadow [my]" & gt; & Lt; Img src = "picture / thumb.jpg" alt = "second" title = "second image" /> gt; & Lt; / A & gt; & Lt; A href = "images / original.jpg" rel = "shadowbox [my]" & gt; & Lt; Img src = "image / thumb.jpg" alt = "first" title = "first image" /> & Lt; / A & gt; Apply and then Shadowbox.init () to body load. It works like a charm when the html is static above. But when I dynamically $ it Call using Ajax and call Shadowbox.init () success; Shadowbox does not work I tried to call when Shadowbox.init () is complete. My code is something like this:
$ (document) .on ('click', '# load_posts_comments', function () {$ .ajax ({url: "Post_comment_json.php", type: "POST", data type: "Jason", data: {user_id: "123"}, success: function (data) {load_posts_comments (data);}, complete: function () {Shadowbox .init ();}}};}); Where am I going wrong? I looked at the Shadow box's website but there was no document about dynamically loaded content. The help would be appreciated.
You must restart it using Shadowbox.clearCache (); and Shadowbox.setup (); .
It's been better said:
Comments
Post a Comment