jQuery Thickbox 和 Google 地图 Extinfowindow
我正在尝试将链接放入 Extinfowindow,通过 Ajax 调用获取其内容。 因此,我单击图钉标记,弹出 Extinfowindow,其中包含我的 ThickBox 链接,当我检查整个页面的 DOM 时,我可以看到该元素正确显示为“thickbox”类。 该链接看起来像这样
<A class="thickbox" title="" href="http://localhost:1293/Popup.aspx?
height=200&width=300&modal=true">Modal Popup</A>
但是,当我单击它时,它会进行完全刷新,并且目标页面会在浏览器中加载,而不是在弹出窗口中加载。 看起来,当 Thickbox 控件的 在初始加载后注入 DOM 时,jQuery 不再能够发挥其魔力并拦截锚链接请求。 有人有关于如何做得更好的想法吗?
I am trying to place a link into an Extinfowindow that obtains its content through an Ajax call. So, I click on a push pin marker, up pops the Extinfowindow with my ThickBox link in it, and when I inspect the DOM for the entire page at that point, I can see the element correctly showing up with the "thickbox" class. The link looks like this
<A class="thickbox" title="" href="http://localhost:1293/Popup.aspx?
height=200&width=300&modal=true">Modal Popup</A>
However, when I click on it, it does a full refresh and the target page loads in the browser, not in a popup.
It seems that when the <A>
for the Thickbox control is injected into the DOM after the initial load, jQuery is no longer able to do its magic and intercept the anchor link request. Does anybody have thoughts about how to do this better?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了同样的问题,除了 Shadowbox 之外。 我最终做的是创建一个函数,在单击锚点时手动打开阴影盒。
看来 ThickBox 此处 可能有一些类似的修复和此处,尽管它们有点旧。 您也许可以利用这些来制定一个好的解决方案。
I had the same problem, except with Shadowbox. What I ended up doing was creating a function to manually open the shadowbox when the anchor is clicked.
It looks like there may be some similar fixes for ThickBox here and here, though they're a bit old. You may be able to work off of these to develop a good solution.