简体   繁体   English

Jquery在Firefox中工作但不在Internet Explorer中工作

[英]Jquery working in Firefox but not Internet Explorer

I'm using the jQuery Cycle plugin (malsup.com/jquery/cycle/) on this page: http://artandculturecenter.org 我使用jQuery Cycle插件(malsup.com/jquery/cycle/)此页上: http://artandculturecenter.org

It works as expected in Firefox and other browsers, but NOT in any version of IE that I've tried -- browser displays all the divs rather then cycling through them. 它在Firefox和其他浏览器中按预期工作,但不是我尝试过的任何IE版本 - 浏览器显示所有div而不是循环浏览它们。 I'm assuming this is because jQuery isn't working/loading at all because of some sort of syntax thing that IE doesn't like, version incompatibility, etc. 我假设这是因为jQuery根本不工作/加载,因为IE不喜欢某种语法,版本不兼容等等。

BUT I have no idea because I'm sort of ignorant of the workings of javascript. 但我不知道因为我对javascript的运作方式一无所知。 Anyone who could point me in the directions of what to look for to fix this would be appreciated! 任何能够指出我想要解决这个问题的方向的人都将不胜感激!

You've got an extra comma at the end of your list of options for the plugin. 你在插件选项列表的末尾有一个额外的逗号。 This isn't python ;-) 这不是python ;-)

Firefox is very forgiving about that sort of thing, IE is NOT. Firefox对此类事情非常宽容,IE不是。 Remove that and it should get rid of the error that's killing your js. 删除它,它应该摆脱杀死你的js的错误。

$("#slideshow").after('<div id="slideshownav">').cycle({ 
        fx: 'fade', 
        timeout: 9000, 
        speed: 1250, 
        pause:  1,
        pager: '#slideshownav'
    });

A tool that helps me a lot is JSLint . 一个对我很有帮助的工具是JSLint Helps you find missing commas, etc. Give it a try. 帮助您找到丢失的逗号,等等。试一试。

See some other tools and tips that I wrote in this answer . 看看我在这个答案中写的一些其他工具和技巧。

Hope these tips could help. 希望这些提示有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM