Examination of new messages without page



  • There's a savage, there's a message in it, until the amount of the messages exceeds the size of the diva - it's fine, it doesn't have to be done. Please tell me how to solve this problem.



  • If I understood you correctly, I could use it. http://api.jquery.com/animate/ ♪ And as an example, for your case http://jsfiddle.net/V4K4N/ ♪

    $("#add").click(function() {
      $("#content").append("<div class='block'>Сообщение<br>в<br/>несколько строк</div>");
      var height = $("body").height();
      $("body").animate({
        "scrollTop": height
      }, 500);
    });
    #content {
      border: 1px solid black;
    }
    .block {
      border: 1px solid red;
    }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    

    <body>
    <div id="content">
    </div>
    <div id="add">
    click
    </div>
    </body>



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2