我正在使用一个名为mCustomScrollbar的jQuery插件,它工作得很好,但是我不能让它完全滚动到页面底部。这是我的代码,希望你能帮我。谢谢。
$(document).on('click','#comentar',function(e){
e.stopPropagation();
e.preventDefault();
$('.comentario').css({'background-image':'url(image/loading.gif)'});
var comentario = $('.comentario').val();
var foto = $('.comentario').attr('id');
var datosComentario='foto='+foto+'&comentario='+comentario;
$.ajax({
type: "POST",
url: "/includes/comentar.php",
data: datosComentario,
cache: false,
beforeSend: function(){
},
success: function(response){
$('#comentarios_cont p').append(response);
$('.comentario').val('').focus();
$("#comentarios_cont").mCustomScrollbar("update");
$("#comentarios_cont").mCustomScrollbar("scrollTo", "bottom");
$('.comentario').css({'background-image':'none'}).val('');
}
});
});它会滚动,但不会滚动到最底部。
发布于 2014-04-17 22:29:03
几分钟前我遇到了这个问题。我的问题是mCSB_container中的div有上边距和下边距。我删除了它们,现在可以了,所以请检查这个。
希望这能有所帮助!
https://stackoverflow.com/questions/23115445
复制相似问题