因此,在我的 div 上加载了一些内容后,我想初始化 jscrollpane,但它不起作用。这是我的代码。看看你们能不能告诉我什么是错的。
阿贾克斯(jQuery)
$("#mision").click(function() {
var id = this.id;
$.ajax({
url: template + "/acciones.php",
type: "POST",
data: "id=" + id,
complete: function() {
},
success: function(x) {
$("#cargaContenido").html(x);
$("#scrollpro").css({'height':(($(window).height())-361)+'px'});
$('#scrollpro').jScrollPane({
});
$(window).resize(function(){
$('#scrollpro').css({'height':(($(window).height())-301)+'px'});
$('#scrollpro').jScrollPane({autoReinitialise: true});
});
$("#scrollpro").trigger('resize');
},
error: function() {
//called when there is an error
},
});
});
它现在可以工作了!