客户要求我用 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/