处理网站上的模式弹出窗口的最佳方法是什么?

发布于 2024-12-21 20:52:18 字数 193 浏览 2 评论 0原文

添加它们的正确方法是

A) 在页面上隐藏 div 内容并在绑定到单击时显示它,

还是

B) 只是异步获取数据并将其加载到隐藏在页面上的空 div 中?

根据下面的回复...用例?这里:

1) 登录

2) 显示“带有社交共享内容的共享模式框”

3) 提交数据

Would the proper way to add them be

A) hiding the div contents on the page and showing it when bound to a click

OR

B) just fetching the data asynchronously and loading it into an empty div that's hidden on the page?

Per the responses below... Use cases? Here:

1) Logging in

2) Showing a "share modal box w/ social sharing stuff"

3) Submission of data

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黑白记忆 2024-12-28 20:52:18

我个人喜欢即时创建它们。

dialog = $("<div></div>");
dialog.html(content);
dialog.dialog({modal:true});

这是使用 jQuery UI 的对话框功能,但只是想动态创建示例。

I personally like to create them on-the-fly.

dialog = $("<div></div>");
dialog.html(content);
dialog.dialog({modal:true});

This is using jQuery UI's dialog feature, but just wanted to example creating on the fly.

小帐篷 2024-12-28 20:52:18

我想说最好的方法是使用 FancyBox 插件

您需要的所有示例都有一个 演示在这里

I would say the best way to go far would be to use the FancyBox Plugin

All the examples you need have a DEMO here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文