自动滚动不起作用

我的自动滚动与jquery不起作用,这是我的CSS中的内容:

#convo_mes{ text-align:left; width:98%; height:80%; background:#fff; border:1px solid #000; overflow-x:auto; } 

在我的js:

 $(".mes").click(function(){ var user = $(this).attr("id"); $("#convo").html(""+user+""); $("#convo_ctrl").show(); $(".send_to").attr("id",user); $(".convo_mes").html("Loading conversation "); setTimeout(function(){auto_scrollmes},3000); setTimeout(function(){get_convo(user)},2000); }); function auto_scrollmes(){ var objDiv = $("#convo_mes"); objDiv.scrollTop = objDiv.scrollHeight; } 

它仍然不工作,我不断改变东西,但仍然没有运气。 这是我的HTML代码:

 

Conversation


Please select a message to load in here!

什么是你的代码不起作用

 $(".mes").click(function(){ var user = $(this).attr("id"); $("#convo").html(""+user+""); $("#convo_ctrl").show(); $(".send_to").attr("id",user); $(".convo_mes").html("Loading conversation "); setTimeout(function(){auto_scrollmes},3000); setTimeout(function(){get_convo(user)},2000); }); function auto_scrollmes(){ var objDiv = $("#convo_mes"); objDiv.scrollTop = objDiv.scrollHeight; } 
 #convo_mes{ text-align:left; width:98%; height:80%; background:#fff; border:1px solid #000; overflow-x:auto; } 
  

Conversation


Please select a message to load in here!