开发者

jquery click function doesn't work in internet explorer 7

I use this code to create a simple jquery carousel animation:

$(document).ready(function() {
var slide = 1;
$('#arrow-left').click(function() {
    if (slide == 1) {
        $("#slideshow-train").animate({left: '-840'}, 2000);
        slide = 2;
    } else if (slide == 2) {
        $("#slideshow-train").animate({left: '-1680'}, 2000);
        slide = 3;
    } else if (slide == 3) {
        $("#slideshow-trai开发者_高级运维n").animate({left: '0'}, 1000);
        slide = 1;
    }
});
});

This code works fine in all major browser except Internet Explorer 7! It even works fine in IE6! The problem is that click function doesn't work in IE7 at all. Can anyone please point out what is the problem and how can I solve it?

Here is the demo of page. Just click the left arrow (the right hand button doesn't work :)). It should work in all browsers excerpt IE7.

http://goo.gl/LVnhW


Check out 'http://www.electrictoolbox.com/jquery-animation-issues-ie7-position-relative/' - it states that 'Internet Explorer 7 can have issues with rendering jQuery animations if some of the properties that are to be animated have not already been set with CSS, and the containing block has the position property set to "relative".'

Also like Tom sugested, you should post your HTML/css as well.


$("selector").live("click", function() {

});

This solved my problem!


well this works for me in IE 7, maybe you should try this jquery plugin http://sorgalla.com/projects/jcarousel/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜