如果元素是静态的,则jssor滑块工作正常,但如果我删除静态元素并通过jquery创建元素,它将无法正常工作
任何提示都将不胜感激
像这样的<div class="container" id="slider1_container">
<div u="slides" class="slider" id="slider2_container">
<!-- Slide -->
<div>
<a href="#"><img u="image" src="./img/landscape/01.jpg"></a>
<div u="caption" t="MCLIP|B" class="caption_1">
<div class="caption_2">
</div>
<div class="caption_3">
this is one
</div>
</div>
</div>
<!-- Slide -->
<div>
<img u="image" src="./img/landscape/04.jpg">
<div u="caption" t="MCLIP|B" class="caption_1">
<div class="caption_2">
</div>
<div class="caption_3">
this is two
</div>
</div>
</div>
</div>
</div>
js code:
function pic_news_load(){
var picnews='';
$.jsonP({
url:serverURL+'/appapi.php?a=getpicnews&callback=?',
success:function(data){
var jsondata=data.result;
for(var i=0;i<jsondata.length;i++){
picnews+='<div><a href="#forum_content" onclick="setItem(\'thread_content_tid\','+jsondata[i].tid+')"><img u="image" src="'+jsondata[i].imgurl+'" ></a>';
picnews+='<div u="caption" t="MCLIP|B" class="caption_1"><div class="caption_2"></div><div class="caption_3">'+jsondata[i].title+'</div></div></div>';
}
picnews=picnews+'</div></div>';
$("#slider2_container").text('');
$("#slider2_container").append(picnews);
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
}
});
}