2010-10-28 58 views
1

我已经使这个jQuery脚本非常基本,但它仍然无法在IE中工作,但在其他浏览器中都可以使用;铬,歌剧,safari和Firefox。jQuery在IE中不起作用

我上传脚本,所以你可以看看

哎呀错误的URL

http://ddart.isgreat.org/test2/ 这是一个

代码以下

$(function() { 
    $('#uploadfile').click(function(){ 
     document.file.submit(); 
    }); 
    $('#upload ul li a.size').click(function(){ 
     if($('li#content').width() == 50){ 
      $('li#content').animate({ 
         width:"540px" 
      }, 1000,function(){ 
       $('#upload img[width=17]').fadeOut('fast', function(){ 
        $('#upload img[width=17]').attr('src','images/arrow_left.png'); 
        $('#file').fadeIn(); 
        $('#upload img[width=17]').fadeIn(); 
       }); 
      }); 
     }else{ 
      $('#file').fadeOut(function() { 
       $('li#content').animate({ 
          width:"50px" 
       }, 1000,function(){ 
        $('#upload img[width=17]').fadeOut('fast', function(){ 
         $('#upload img[width=17]').attr('src','images/arrow_right.png'); 
         $('#upload img[width=17]').fadeIn(); 
        }); 
       }); 
      }); 
     }; 
      return false; 
    }); 
}); 

所有正确的我能得到的帮助非常感谢。

+0

我们不能访问你的本地主机,查看网页...的HTML片段将有助于调试.. – Oliver 2010-10-28 10:11:59

+0

我已经更新了相应的链接 – Breezer 2010-10-28 10:23:11

回答

2

啊,你需要防止单击时链接的事件。

修订本

$('#upload ul li a.size').click(function(e){ 
    e.preventDefault(); 
+0

我更新了链接,所以它应该工作。 那么它不工作在ie8这是最​​奇怪的部分 我试图在$(function(){})调用后添加警报,但没有任何反应,因为我在所有其他浏览器中获得100警报 – Breezer 2010-10-28 10:18:02

+0

nope did not do it:/ – Breezer 2010-10-28 10:31:50

+0

我更新了我的答案 – Drewid 2010-10-28 10:33:19