如何在 fbml 或 fbjs 中创建模式类型警报/对话框
我需要在弹出时创建一个警报框或对话框,它会像模态类型警报框一样锁定后屏幕。但这次我需要fbjs。或 fbml 任何人都可以帮助我...
I need to make a alert box or dialog box when popup it lock the back screen like a Modal type alert box. but this time i need in fbjs. or fbml any one can help me please...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种欺骗方法是为 div 赋予
position:absolute
的 css 属性,并将 div 与内容顶部对齐,并使用z-index
高于页面上的其他所有内容(通常人们使用 100 之类的数字)。这将成为您的模态容器,在其中您只需模仿/复制典型 FB 模态窗口的样式。另外,在内容的顶部或底部创建另一个
div
,并为其赋予position:absolute; 的 css 属性。宽度:100%;高度:100%;背景:#000;不透明度:.5; z-index: 50
(确保 z-index 小于模态容器)。这是您的覆盖层,它会阻止页面内容进行交互,直到用户对您的模式执行某些操作。我建议以这种方式解决该问题,因为就像 @dragonjet 指出的那样,FBML 已被弃用,并且您无法再创建新的 FBML 应用程序。没有 FBML,就没有 FBJS。
One way to cheat this is to give the div a css attribute of
position: absolute
and align your div on top of your content, with az-index
of something higher than everything else on your page (typically, people use something like 100). This becomes your modal container, and within it you'll just want to mimmic/copy the styles of a typical FB modal window.Also, create another
div
at the top or bottom of your content, and give it css properties ofposition: absolute; width: 100%; height: 100%; background: #000; opacity: .5; z-index: 50
(make sure z-index is less than your modal container). This is your overlay, which blocks the content of the page from being interacted with until the user does something with your modal.I would suggest going about the solution this way because like @dragonjet pointed out, FBML is deprecated, and you can't create new FBML applications anymore. Without FBML there is no FBJS.