JQuery Ajax 使用加载器加载外部 html
是否可以将 colorbox 及其动画放在扩展的 div 中而不是新的中模态窗口?不确定 colorbox 是执行此操作的正确方法。
我想用 ajax 将外部 html 加载到 div 中,但保留 colorbox 具有的关闭、动画和加载功能。
任何想法将不胜感激。
Is it possible to have colorbox and its animations in an expanding div rather than a new modal window? Not sure colorbox is the correct way to do this.
I want to ajax load external html into a div but keep the close, animation and loading functions colorbox has.
Any thoughts would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然! colorbox 只是查看您要应用 colorbox 的
标记的
href
属性。该标签是否链接到图像或 html 文件并不重要,它都会将内容加载到精美的 colorbox 框架中。例如,在您的主页内容中:
在您的 javascript 中:
单击链接应将
yourPage.html
的内容加载到展开的 div 中。编辑:哦,我不明白你的问题。我想如果你不想要覆盖层和居中框架,你可以用一些CSS来改变它。将其添加到主页的 CSS 中:
编辑 编辑:这可能不起作用,因为脚本将覆盖这些 css 声明。我不知道解决方案是什么。
Certainly! colorbox simply looks at the
href
attrbibute of the<a>
tag that you're applying colorbox to. It doesn't matter whether that tag links to an image or an html file, it will load the content into a fancy colorbox frame.For example, in your main page content:
And in your javascript:
Clicking the link should load the contents of
yourPage.html
into an expanding div.EDIT: Oh, I didn't understand your question. I guess if you don't want the overlay and the centered frame, you could change it with some css. Add this to the CSS of your main page:
EDIT EDIT: This probably won't work because the script will override these css declaration. I don't know what the solution is.