问题与jQuery在IE8与Fancybox [英] Problem with jQuery in IE8 with Fancybox

查看:174
本文介绍了问题与jQuery在IE8与Fancybox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近收到了一个旧网站(我们正在谈论表格,图片地图,你的名字)。



我被要求建立一个旧的链接到Flash画廊变成灯箱。我在图库链接(右上角)使用了一个 javascript:openLightbox()。我知道,我知道,但在这个网站上似乎不太适用。



无论如何,我还包括一个JavaScript文件脚本.js,其中




  • 包含用于 fancybox

  • 使用AJAX获取图像文件名的JSON

  • 在页面上创建一个隐藏的无序列表,其中包含链接从JSON的图像

  • 将fancybox方法附加到这些图像



然后,在 openLightbox()我只需在第一个链接上调用 click()函数。



很好,我想。它在Firefox中像一个魅力。然后我的拱门决定了它不想打球。这是IE7 / 8。



我已经有IE8开发工具了一段时间,但还没有弄清楚。
我得到的唯一错误是v是null或不是一个对象,它引用了Google的CDN上的最小化/打包的jQuery代码。显然这不是问题,任何人都有什么想法这里有什么问题?



这是一个链接到页面: http://edgewaterterraces.com.au/



另外...





非常感谢您的时间。



更新



哇,似乎在这个页面。什么给了?

解决方案

您正在首页嵌入两次jquery和script.js。



一行在第12行,一次在第27行。


I recently aquired an old website (we're talking tables, image maps, you name it).

I was asked to make an old link to a Flash gallery into a lightbox. I simply used a javascript: openLightbox() on the gallery link (top right corner). I know, I know, but it doesn't seem out of place on this site.

Anyway, I also include a JavaScript file scripts.js, which

  • Includes jQuery and CSS files for fancybox.
  • Use AJAX to get some JSON of image filenames
  • Create a hidden unordered list on the page with links to the images from JSON
  • Attach the fancybox method to these images

Then, on the openLightbox() I simply call the click() function on the first link.

Nice and easy, I thought. It worked like a charm in Firefox. Then my arch nemesis decided it didn't want to play ball. That's IE7/8.

I've had the IE8 Developer Tools out for a while but haven't been able to figure it out. The only error I'm getting is "v is null or not an object" which is referencing the minified/packed jQuery code on Google's CDN. Obviously that's not the problem, so does anyone have any idea what is wrong here?

Here is a link to the page: http://edgewaterterraces.com.au/

Also...

Thank you very much for your time.

UPDATE

Wow, it seems to work on this page. What gives?

解决方案

You are embedding both jquery and script.js twice on the front page.

Once in line 12, once in line 27.

这篇关于问题与jQuery在IE8与Fancybox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆