0

ページにサイクル プラグインをセットアップし、ajax を介して動的コンテンツをページに呼び出しています。次に、このコンテンツを div に入れて、プラグインを実行します。問題は、ページをロードするときに完全に機能し、ページを更新するとまったくロードされないことです。

助言がありますか?

    $.ajax({
  url: "http://www.site.co.uk/cgi-bin/latest-instructions-2.pl",
  success: function(html){
    $("#slider").html(html);
  }
});
$('#slider').cycle({ 
    fx: 'scrollLeft',
    cleartype: true,
        cleartypeNoBg: true,
        pager: '#li-number2',
        requeueOnImageNotLoaded: true  
});
4

1 に答える 1

0

ページが読み込まれる前にスライダーが実行されていたため、ウィンドウのオンロード機能を追加しただけです...

$(window).bind("load", function() {
$('#slider').cycle({ 
    fx: 'scrollLeft',
    cleartype: true,
        cleartypeNoBg: true,
        pager: '#li-number2',
        requeueOnImageNotLoaded: true  
});
});
于 2011-09-13T14:59:24.017 に答える