0

私はこの表現を持っています:

$('#animationNext,#animationPrev').bind('mousedown',function(){        
    $('.nInfoIE').show();
    $('ul.roundabout-holder li').find('.iframe').css({'visibility':'hidden'});
    $('ul.roundabout-holder li').find('.iframe').addClass('esconder');

    // more code...

    watching = false;
    $('.nInfoIE').hide();
});

質問で多くの表現を削除したことに注意してください。

これはすべてのブラウザーでうまく機能しますが、IE6 ではロガーの実行に 10 倍の時間がかかります (約 7 秒ほどかかります!) <div class="nInfoIE">。最後に隠すために、

しかし、それはすべて同時に実行されているようですが、nInfoIe の内容がまったく表示されないため、

前にそれを確認してから、残りが実行されるようにするにはどうすればよいですか?

-編集- html コード:

<ul class="roundabout-holder" style="padding: 0px; position: relative; z-index: 100;">
    <li class="roundabout-moveable-item roundabout-in-focus" style=
    "position: absolute; left: 157.2px; top: -0.8px; width: 240px; height: 160px; opacity: 1; z-index: 400; font-size: 16px;"
    current-scale="1.0000">
      <a href="#" title="video#1"><img src="http://img.youtube.com/vi/qZ9jpnMGkdA/0.jpg"
      class="thumbImg"><img alt="video#1" class="playIcon" src=
      "img/playIcon.png"><span class="titulo titThumb">video#1</span></a>

      <div class="iframe esconder">
        <iframe width="560" height="315" frameborder="0" allowfullscreen="" src=
        "http://youtube.com/embed/qZ9jpnMGkdA"></iframe>
      </div><span class="titulo titIframe">video#1</span>
    </li>

    <li class="roundabout-moveable-item" style=
    "position: absolute; left: -58.8px; top: 23.2px; width: 168px; height: 112px; opacity: 0.7; z-index: 250; font-size: 11.2px;"
    current-scale="0.7000">
      <a href="#" title="video#2"><img src="http://img.youtube.com/vi/hurnoKLuBD8/0.jpg"
      class="thumbImg"><img alt="video#2" class="playIcon" src=
      "img/playIcon.png"><span class="titulo titThumb">video#2</span></a>

      <div class="iframe esconder">
        <iframe width="560" height="315" frameborder="0" allowfullscreen="" src=
        "http://youtube.com/embed/hurnoKLuBD8"></iframe>
      </div><span class="titulo titIframe">video#2</span>
    </li>

    <li class="roundabout-moveable-item" style=
    "position: absolute; left: 229.2px; top: 47.2px; width: 96px; height: 64px; opacity: 0.4; z-index: 100; font-size: 6.4px;"
    current-scale="0.4000">
      <a href="#" title="video#3"><img src="http://img.youtube.com/vi/Lk_WoaLUPdA/0.jpg"
      class="thumbImg"><img alt="video#3" class="playIcon" src=
      "img/playIcon.png"><span class="titulo titThumb">video#3</span></a>

      <div class="iframe esconder">
        <iframe width="560" height="315" frameborder="0" allowfullscreen="" src=
        "http://youtube.com/embed/Lk_WoaLUPdA"></iframe>
      </div><span class="titulo titIframe">video#3</span>
    </li>

    <li class="roundabout-moveable-item" style=
    "position: absolute; left: 445.2px; top: 23.2px; width: 168px; height: 112px; opacity: 0.7; z-index: 250; font-size: 11.2px;"
    current-scale="0.7000">
      <a href="#" title="video#4"><img src="http://img.youtube.com/vi/m5ykAFtQgQ0/0.jpg"
      class="thumbImg"><img alt="video#4" class="playIcon" src=
      "img/playIcon.png"><span class="titulo titThumb">video#4</span></a>

      <div class="iframe esconder">
        <iframe width="560" height="315" frameborder="0" allowfullscreen="" src=
        "http://youtube.com/embed/m5ykAFtQgQ0"></iframe>
      </div><span class="titulo titIframe">video#4</span>
    </li>
  </ul>
4

2 に答える 2

1

'morecode'セクションが1つ以上のajaxリクエストで機能すると想定することしかできません。ajaxリクエストが発生した後、ajaxリクエストがまだ実行されていなくても、次の式が処理されます。ajaxリクエストの完全なイベントでは、読み込み中の画像を非表示にする必要があります。

$.ajax({
  type: 'POST',
  url: url,
  data: data,
  success: success,
  complete: function() { watching = false;
                    $('nInfoIE').hide(); }
});

複数のajaxリクエストがある場合は、もう少し複雑になります。それらをネストするか、何らかのajaxキューマネージャーを使用する必要があります。

于 2011-10-13T12:10:47.830 に答える
0

さて、あなたはコードを提供しましたが、クラス名「nInfoIE」を持つ要素は見当たりません。これは、ここでちょっと関係があります。

しかし、私はあなたのセレクターに気づきました:

$('nInfoIE').show();

クラス名で要素を取得しようとしているので、「.」を指定する必要があります。その前に。そのはず

$('.nInfoIE').show();
于 2011-10-13T14:44:07.050 に答える