IE中的jQuery,.click,.animate等

时间:2011-07-25 20:54:55

标签: jquery internet-explorer

此代码在Chrome中完美运行,但在IE中则无法运行。

我在网上看到过类似的问题,但不太了解解决方案,也许发布具体的代码会对我有所帮助。感谢。

<script type="text/javascript">


$(document).ready(function(){
    $("#bgimage").slideDown();
    $("#rcapmenu").delay(1000).animate({opacity: ".9", filter: "alpha(opacity=90)", top: "75%", height: "168px"}, "slow");
        $("#menutext").delay(1500).animate({height: "45px"}, "slow");
    $("#LOGIN").delay(2200).animate({height: "44px", left: "0px"}, "slow");
    $("#CLIENT").delay(2500).animate({height: "44px", left: "0px"}, "slow");
    $("#ABOUT").delay(2800).animate({height: "44px", left: "0px"}, "slow");
    $("#MANAGER").delay(3100).animate({height: "44px", left: "0px"}, "slow");
    $("#rcaplogo").delay(2100).animate({opacity: "1", filter: "alpha(opacity=100)"}, "slow");       $(".slidingDiv").hide();

$('#MANAGER').bind('click', function(){

$(".slidingDiv").animate({height: "0px", top: "455px"}, "slow").delay(1000).animate({height: "450px", top: "0px"}, "slow");
getdata('text.php','slidingDiv');
});

$('#ABOUT').click(function(){

$(".slidingDiv").animate({height: "0px", top: "455px"}, "slow").delay(1000).animate({height: "450px", top: "0px"}, "slow");
getdata('text.php','slidingDiv');
});

$('#CLIENT').click(function(){

$(".slidingDiv").animate({height: "0px", top: "455px"}, "slow").delay(1000).animate({height: "450px", top: "0px"}, "slow");
getdata('text.php','slidingDiv');
});

$('#LOGIN').click(function(){

$(".slidingDiv").animate({height: "0px", top: "455px"}, "slow").delay(1000).animate({height: "450px", top: "0px"}, "slow");
getdata('text.php','slidingDiv');
});

$('.right').click(function(){
$(".slidingDiv").animate({height: "0px", top: "455px"}, "slow");
}); 
});
</script>

当我点击具有相应ID的div时,IE中没有任何事情发生,但在Chrome中,我正在寻找的效果完美无缺。我尝试了两个.bind('click',function().....和你正好看的.click。

1 个答案:

答案 0 :(得分:1)

我建议将效果放在像这样的新JQuery函数中:

jQuery.fn.EFFECT NAME = YOUR EFFECT

所以你可以这样做:

$('#id').EFFECT NAME();

抱歉,我不能再帮忙了,但这可能会稍微改善一下代码。