How to bind a dynamic DIV to Jquery Masonry plugin?

后端 未结 3 1914
借酒劲吻你
借酒劲吻你 2021-01-20 16:25

I have some DIV\'s in my HTML that I load dynamically using AJAX.

$(\"#workPanel\").load(\"ex.html\");

I also have some static links that onclic

3条回答
  •  佛祖请我去吃肉
    2021-01-20 16:46

    I think this is what you're after:

    To run masonry again you need to shuffle once the .load() completes, you can do this by running it as the callback function, like this:

    $("#workPanel").load("ex.html", function() {
      $('#primary').masonry();
    });
    

提交回复
热议问题