Colorbox Ajax 加载外部页面但仅加载特定 Div
希望以前有人这样做过...
我尝试使用 Colorbox 及其 Ajax 功能加载外部页面。
使用 colorbox 示例中的 ajax 链接,您可以使用如下链接:
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
这将使用 colorbox 覆盖层将该页面 ajax.html 加载到您的页面中,我想做的是在 ajax.html 中加载特定的 div。所以像这样:
<p><a class='ajax' href="../content/ajax.html#ThisDivOnly" title="Homer Defined">Outside HTML (Ajax)</a></p>
所以只加载DIV:#ThisDivOnly
已经尝试了上面的方法,但没有喜欢。
帮助表示赞赏。第一次发帖。 :)
hopefully someone has done this before...
Im trying to load an external page using Colorbox and its Ajax function.
using a ajax link from the example at colorbox you use a link like so:
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
This will load that page ajax.html into your page with the colorbox overlay, What I would like to do is load a specific div in the ajax.html. so something like:
<p><a class='ajax' href="../content/ajax.html#ThisDivOnly" title="Homer Defined">Outside HTML (Ajax)</a></p>
so only loading the DIV: #ThisDivOnly
have tried the above but no love.
Help appreciated. First time post. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会检查这个问题: Colorbox Load Specific div from iFrame
看起来像那里已经回答得很好了。
I'd check out this question: Colorbox Load Specific div from iFrame
Looks like it's answered pretty well in there.