使用AJAX在div内的缩略图滚动条

我使用jquery卷轴为我的摄影网站,我无法让它工作。 我使用这两个文件:

main.php

     
function show() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("display").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","thumbs.php",true); xmlhttp.send(); }

还有thumbs.php

        
jQuery.noConflict(); (function($){ window.onload=function(){ $("#tS2").thumbnailScroller({ scrollerType:"hoverPrecise", scrollerOrientation:"horizontal", scrollSpeed:2, scrollEasing:"easeOutCirc", scrollEasingAmount:600, acceleration:4, scrollSpeed:800, noScrollCenterSpace:10, autoScrolling:0, autoScrollingSpeed:2000, autoScrollingEasing:"easeInOutQuad", autoScrollingDelay:500 }); } })(jQuery);

AJAX加载正常。 其他一切看起来都不错。 这里的问题是div内容根本不可滚动。 它显示一切正确,但div内容也没有排列或滚动,如下所示:

http://manos.malihu.gr/jquery-thumbnail-scroller (代码的来源)

问题在于使用AJAX加载我的内容(这是强制性的),但我没有知识来解决这个问题。 有人可以帮帮我吗?

提前致谢。

所有答案之后,这里是工作代码(感谢@Abhidev):

main.php

          
function show() { $.ajax({ url: "TESTE.php", success: function(data) { $('#display').html(data); //Initiate the scroller here $("#tS2").thumbnailScroller({ scrollerType:"hoverPrecise", scrollerOrientation:"horizontal", scrollSpeed:2, scrollEasing:"easeOutCirc", scrollEasingAmount:600, acceleration:4, scrollSpeed:800, noScrollCenterSpace:10, autoScrolling:0, autoScrollingSpeed:2000, autoScrollingEasing:"easeInOutQuad", autoScrollingDelay:500 }); } }); }

thumbs.php

         

既然你正在使用jquery,那么你只需要使用.ajax()方法

 function show(){ $.ajax({ url: "thumbs.php", success: function(data) { $('#display').html(data); //Here is the change //Initiate the scroller here $("#tS2").thumbnailScroller({ scrollerType:"hoverPrecise", scrollerOrientation:"horizontal", scrollSpeed:2, scrollEasing:"easeOutCirc", scrollEasingAmount:600, acceleration:4, scrollSpeed:800, noScrollCenterSpace:10, autoScrolling:0, autoScrollingSpeed:2000, autoScrollingEasing:"easeInOutQuad", autoScrollingDelay:500 }); }); } 

有关更多详细信息和选项,请参阅http://api.jquery.com/jQuery.ajax/