0

私の jQuery 関数は HTML をロードしますが、その HTML は別の関数 (flowplayer から) から別の jQuery セレクターをロードしません

flowplayer("player", {src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", cachebusting: true, wmode: "transparent"});
   $('#options li a').click( function (evt){
    evt.preventDefault();
    $('#options li').removeClass('current');
         $(this).parent('li').addClass('current');
    var rackVideo = $(this).attr('href'); //JQUERY PULLS INFO FROM LINK
    var rackOutput =
        '<a href="http://c3426439.r39.cf0.rackcdn.com/pritchett/'+     rackVideo +'" id="player" style="display:block;width:348x;height:216px; display:block;">'+
        '<img src="http://www.p2ortho.com/wp-content/uploads/2010/10/intro-thumb.jpg" alt="Introduction Video" title="Introduction Video" width="348" height="216" class="alignnone size-full wp-image-620" />'+
        '</a>';
    $('#slidedata').html(rackOutput);
});

出力である html の id="player" は、flowplayer 関数を呼び出すことを想定しており、機能していません。私は何を間違っていますか?どうもありがとう。

4

2 に答える 2

2

次の行...

flowplayer("player", {src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", cachebusting: true, wmode: "transparent"});

...次の行の直後に表示する必要があります:

$('#slidedata').html(rackOutput);

なんで?id="player"要素がドキュメントに存在するときだからです。

于 2012-06-06T19:54:22.317 に答える
0

このページへのリンクを提供するか、JS Fiddleをセットアップしてください。JavaScript が実行されている完全な html を見ないと、何が問題なのかを正確に知ることは困難です。明らかに間違っているところは見当たりませんが、ページ全体を見ないとどうしようもありません。

于 2012-06-06T19:53:56.907 に答える