ajax后Zurb基础均衡器调整大小 [英] Zurb foundation equalizer resize after ajax

查看:84
本文介绍了ajax后Zurb基础均衡器调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了Foundation均衡器的问题,我尝试在用ajax更改内容后动态地重新调整带有均衡器的div高度.我搜索了基金会文档,堆栈溢出,但是找不到该问题的答案.

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();
        });
    });

推荐答案

对于Foundation 6:

Foundation.reInit('equalizer');

文档中的更多信息: http ://foundation.zurb.com/sites/docs/javascript.html#adding-plugins-after-page-load

这篇关于ajax后Zurb基础均衡器调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆