0

ここに私のスクリプト:http://jsfiddle.net/3XwZv/153/

HTML

<div id="box1" class="choice" style="background:blue;">
    <div class="selection ordinateur">
        <div class="choix1"><a class="link1" href="#"></a></div>
    </div>
</div>

<div id="box2" class="choice" style="display:none;background:red;">
    <div class="selection ordinateur">
        <div class="choix1"><a class="link2" href="#"></a></div>
    </div>
</div>


<div id="box3" class="choice" style="display:none;background:green;">
    <div class="selection ordinateur">
        <div class="choix1"><a href="#"></a></div>
    </div>
</div>

JS

$(".link1").click(function() {
    $('#box1').fadeOut("slow", function(){
        $('#box2').css("display","block");
        $('#box2').replaceWith(div);

       $('#box1').fadeIn("slow");
    });
    $('.link1').fadeOut("slow");
    return false;
});


$(".link2").click(function() {
    $('#box2').fadeOut("slow", function(){
        $('#box3').css("display","block");
        $('#box3').replaceWith(div);

       $('#box2').fadeIn("slow");
    });
    $('.link2').fadeOut("slow");
    return false;
});

主な目標は、巨大な正方形をクリックすると、3つの異なるアクションが発生することです。ただし、Internet Explorerでは、2番目にブロックします。(赤い四角は緑の四角には行きません)。
助けてください!

4

1 に答える 1

0

show()jqueryとhide()関数を使用してdivの可視性を表示および非表示にすることで、divの可視性を変更しました。以下のフィドルを更新しました。

http://jsfiddle.net/VP8ub/2/

それがあなたが必要なものであることを願っています。私はIE9でテストし、それがうまく機能しました。

于 2012-11-19T22:54:25.453 に答える