Problem with jQuery in IE8 with Fancybox

隐身守侯 提交于 2019-12-11 01:40:33

问题


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...

  • script.js file

Thank you very much for your time.

UPDATE

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


回答1:


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

Once in line 12, once in line 27.



来源:https://stackoverflow.com/questions/2241615/problem-with-jquery-in-ie8-with-fancybox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!