javascript - Firefox 未在切换的 div 中加载 wuFoo 表单

标签 javascript jquery html css

客户要求我用 wufoo 表单替换联系人。默认情况下,保存表单的 div 设置为不显示,然后在单击“单击此处”div 时设置为 slideToggle。这在 chrome 或 safari 中不是问题,但在 firefox 中不起作用?

html:

<div class="brideclick">
                    Click here to email us
                    </div>

                    <div class="brideform pad-none">
                        <div id="wufoo-rei92q70h44gkt">
                        Fill out my <a href="link-to-wufoo-form">online form</a>.
                    </div>
                        <script type="text/javascript">var rei92q70h44gkt;(function(d, t) {
                        var s = d.createElement(t), options = {
                        'userName':'theweddingaffair',
                        'formHash':'rei92q70h44gkt',
                        'autoResize':true,
                        'height':'2359',
                        'async':true,
                        'host':'wufoo.com',
                        'header':'show',
                        'ssl':true};
                        s.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + 'www.wufoo.com/scripts/embed/form.js';
                        s.onload = s.onreadystatechange = function() {
                        var rs = this.readyState; if (rs) if (rs != 'complete') if (rs != 'loaded') return;
                        try { rei92q70h44gkt = new WufooForm();rei92q70h44gkt.initialize(options);rei92q70h44gkt.display(); } catch (e) {}};
                        var scr = d.getElementsByTagName(t)[0], par = scr.parentNode; par.insertBefore(s, scr);
                        })(document, 'script');</script>
                    </div>

jQuery:

$( ".brideclick" ).click(function() {
$( ".brideform" ).slideToggle( "slow", function() {
});
});

CSS:

.brideform{
    display: none;
}

最佳答案

在脚本中试试这个:

$(document).on('click','.brideclick',function() {
    $( ".brideform" ).slideToggle( "slow");
});

关于javascript - Firefox 未在切换的 div 中加载 wuFoo 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35627856/

相关文章:

javascript - 脚本5007 : Unable to get value of the property 'indexOf' : object is null or undefined in IE

javascript - SVG 转 PNG 转 AJAX API 帖子

javascript - 使用 anchor 标签平滑滚动时左右轮播控件不起作用

html - CSS 宽度超出指定值

javascript - 如何使历史 API 中的链接像真实的一样工作?

javascript - 在 For 循环中使用 Math.max() 时出现问题

javascript - 如何初始化具有数组的 Typescript 接口(interface)?

具有基于 Ajax 的内容的 jQuery UI 选项卡 : how to avoid first panel loaded by AJAX call

javascript - 删除 Google 文档中的空行

javascript - 启用 iframe 的设计模式