Colorbox Ajax 加载外部页面但仅加载特定 Div

发布于 2025-01-05 15:55:58 字数 576 浏览 4 评论 0原文

希望以前有人这样做过...

我尝试使用 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 技术交流群。

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

发布评论

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

评论(1

任谁 2025-01-12 15:55:58

我会检查这个问题: 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.

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