简体   繁体   中英

Zurb foundation equalizer resize after ajax

I ran into a problem with Foundation equalizer, I am trying to dynamically readjust div heights with equalizer after I change content with ajax. I searched Foundation documentation, Stack overflow but I found no answer to this problem.

I noticed that it readjusts when I resize the browser, so it is possible, I just want to find out how to trigger it. (I obviously don't want to tell visitors to resize the browser every time they click a link)

edit: This seems to work, but is that the best solution?

$("#media").click(function(){
        $.ajax({
        url: "mediaproduction.html"
        })
        .done(function( html ) {
            $( "#main-content" ).html( html );

            $(document).foundation();
        });
    });

For Foundation 6 :

Foundation.reInit('equalizer');

More info in the doc : http://foundation.zurb.com/sites/docs/javascript.html#adding-plugins-after-page-load

这是我们在网站上使用的用于执行您正在谈论的事情:

$(document).foundation('equalizer','reflow');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM