html - JQuery scrolling to a div inside a div with scrollbar -


i want scroll specific div inside div has scrollbars.

enter image description here

var div_terms = $('#div_terms').offset();      $("#scroll_to_accept").click(function (){         //$(this).animate(function(){             $('html, body').animate({scrolltop: div_terms.top}, "slow");         //});     }); 

div terms div inside scrollable div. link click scroll div in <legend> outside <fieldset> div.

what want user clicks on "scroll end , accept" div should scroll down "div_terms" div shown in figure.

  1. scroll_to_accept id of link click.
  2. terms id of scrollable div
  3. div_terms position there needs scrolled.

    var div_terms = $('#div_terms').offset(); $("#scroll_to_accept").click(function (){            scroll_to_terms(); });  function scroll_to_terms() {       $('#terms').animate({scrolltop: div_terms.top}, "slow"); } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -