Pretty photo ibox doesn't trigger after appending new element in HTML

Posted by user1469133 on Stack Overflow See other posts from Stack Overflow or by user1469133
Published on 2012-06-20T11:59:27Z Indexed on 2012/06/26 9:16 UTC
Read the original article Hit count: 175

Filed under:
|
|
|
|

I'm trying to get prettyPhoto or some other jquery plugin to work after I append new element to the HTML page:

to be specific I have this:

$(document).ready(function() { 
              $(window).scroll(function() {
                if($(window).scroll) {  
                  $('div#loadMoreComments').show();

                    $.ajax({
                                type    : "POST",
                                url     : "getvariables.php",
                                dataType: "json",
                                data    : { webid: $(".posts:last").attr('id') }
                            }).done(function( msg ) {

                                   jQuery.each(msg , function(index, value){
                                        $("#posts").append(value);
                                    });


                                    //    $("#posts").append(msg);

                                    $('div#loadmore').hide();

                                });
                }
              });
            });

Then I have something like this that has to trigger the popup

<p><a href="#inline-1" rel="ibox">Trigger popup.</a></p>
    <div id="inline-1" style="display: none;">
             Content to show up after the link is triggered

    </div>

Will appreciate any help over this. Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about triggers