我最近刚刚实现了Magnific Popup"并且弹出窗口很好,但是当我单击输入框时,整个弹出窗口消失回父页面.在插件网站上显示的示例中,整个对话框都是可单击的,直到您在该框外单击.
我希望它只是我错过的极其简单的东西,但它仍然在我脑海中.
非常感谢我能得到的任何帮助!
谢谢:)
解决方案如果你使用ajax"内容类型,你需要确保你只有一个根节点.
dimsemenov/plugins/magnific-popup/documentation.html#ajax_type
例如,这是正确的 ajax 文件内容:
html内容<script src="something.js"></script></div>不正确:
<script src="something.js"></script>html内容</div>不正确:
html内容</div><div>其他内容</div>还要确保 closeOnContentClick 设置为 false dimsemenov/plugins/magnific-popup/documentation.html#closeoncontentclick
如果由于某种原因,您无法更改 ajax 文件的内容,则可以在 parseAjax 回调中解析内容,如 here(所以 mfpResponse.data 只包含一个根节点).
I've just recently implemented the 'Magnific Popup' and the popup comes up fine, however when I click an input box the entire popup disappears back to the parent page. On the examples shown on the plugin website, the entire dialog box is clickable until you click outside of that box.
I'm hoping its just something extremely simple I've missed, but it's still doing my head in.
I really appreciate any help I can get!
Thanks :)
解决方案If you're using "ajax" content type, you need to make sure that you've got only one root node.
dimsemenov/plugins/magnific-popup/documentation.html#ajax_type
E.g., this is correct contents of ajax file:
<div> html content <script src="something.js"></script> </div>Incorrect:
<script src="something.js"></script> <div> html content </div>Incorrect:
<div> html content </div> <div>Another content</div>Also make sure that closeOnContentClick is set to false dimsemenov/plugins/magnific-popup/documentation.html#closeoncontentclick
If, for whatever reason, you can't change the contents of ajax file, you may parse content in parseAjax callback, like described here (so the mfpResponse.data contains only one root node).
更多推荐
Magnific Popup
发布评论