Jquery灯箱问题

发布于 2024-11-04 17:50:02 字数 814 浏览 5 评论 0 原文

我快要疯了 - 我无法让我的 Jquery 灯箱工作...如果有人能快速浏览一下那就太好了!

网站是 http://www.layersoflondon.org/index-with-jquery.html

我认为问题在于标题中的 Google 地图 Javascript 和 Jquery lightbox 存在冲突。例如,我通过在 Google 地图中的图像链接上放置 onclick 事件来使 Slimbox 工作:

camdenSuperstoreContent.innerHTML = "";

问题是 Slimbox 使用 Mootools,而我想使用 Jquery 来处理其他一些东西......

是有没有办法用灯箱做到这一点?

感谢您的任何建议。

非常感谢。

I'm going crazy here - I can't get my Jquery lightbox to work... Would be great if someone could have a quick look!

Site is http://www.layersoflondon.org/index-with-jquery.html

I think the problem is that there is a conflict with the Google Maps Javascript in the header and the Jquery lightbox. For example I got Slimbox working by putting an onclick event on the image links in the Google map:

camdenSuperstoreContent.innerHTML = "<a rel=\"lightbox\" href=\"images/project-images/camden-superstore.jpg\" onclick=\"Slimbox.open('images/project-images/camden-superstore.jpg', 'Camden Superstores');return false\"><img src=\"images/project-images/camden-superstore-thumb-no-border.jpg\" /></a>";

The problem is that Slimbox uses Mootools and I want to use Jquery for some other stuff...

Is there a way to do this with the lightbox?

Grateful for any suggestions.

Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

抱着落日 2024-11-11 17:50:02

在 javascript 控制台中,当我单击任何图像时,会出现一条消息“Uncaught ReferenceError:Slimbox 未定义”。您在标头中注释掉了 Slimbox 库,而是使用 jquery.lightbox。但您的图像仍然包含以下内容:

Slimbox.open('images/project-images/railway-bridge.jpg', 'The bridge');return false"

删除对 Slimbox 的所有引用。另外,您应该仅在页面上出现图像后(即呈现 Google 地图后)调用以下函数:

$(function(){
    initialize();
    $('a[@rel*=lightbox]').lightBox({fixedNavigation:true});
});

In javascript console there is a message "Uncaught ReferenceError: Slimbox is not defined" when I click on any image. You commented out Slimbox library in header and instead use jquery.lightbox. But your images still contains this:

Slimbox.open('images/project-images/railway-bridge.jpg', 'The bridge');return false"

Remove all references to Slimbox. Also you should call following function only after images is present on the page, i.e. after Google map is rendered:

$(function(){
    initialize();
    $('a[@rel*=lightbox]').lightBox({fixedNavigation:true});
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文