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. 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.
它在Firefox和其他浏览器中按预期工作,但不是我尝试过的任何IE版本 - 浏览器显示所有div而不是循环浏览它们。我假设这是因为jQuery根本没有工作/加载,因为IE不喜欢某种语法,版本不兼容等等。
BUT I have no idea because I'm sort of ignorant of the workings of javascript. Anyone who could point me in the directions of what to look for to fix this would be appreciated!
但我不知道因为我对javascript的工作方式一无所知。任何能够指出我想要解决这个问题的方向的人都将不胜感激!
2 个解决方案
#1
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. Remove that and it should get rid of the error that's killing your js.
Firefox对此类事情非常宽容,IE不是。删除它,它应该摆脱杀死你的js的错误。
$("#slideshow").after('<div id="slideshownav">').cycle({
fx: 'fade',
timeout: 9000,
speed: 1250,
pause: 1,
pager: '#slideshownav'
});
#2
A tool that helps me a lot is JSLint. Helps you find missing commas, etc. Give it a try.
一个对我很有帮助的工具是JSLint。帮助您找到丢失的逗号,等等。试一试。
See some other tools and tips that I wrote in this answer.
看看我在这个答案中写的一些其他工具和技巧。
Hope these tips could help.
希望这些提示有所帮助。
#1
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. Remove that and it should get rid of the error that's killing your js.
Firefox对此类事情非常宽容,IE不是。删除它,它应该摆脱杀死你的js的错误。
$("#slideshow").after('<div id="slideshownav">').cycle({
fx: 'fade',
timeout: 9000,
speed: 1250,
pause: 1,
pager: '#slideshownav'
});
#2
A tool that helps me a lot is JSLint. Helps you find missing commas, etc. Give it a try.
一个对我很有帮助的工具是JSLint。帮助您找到丢失的逗号,等等。试一试。
See some other tools and tips that I wrote in this answer.
看看我在这个答案中写的一些其他工具和技巧。
Hope these tips could help.
希望这些提示有所帮助。