html - JQuery scrolling to a div inside a div with scrollbar -
i want scroll specific div inside div has scrollbars.
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.
- scroll_to_accept id of link click.
- terms id of scrollable div
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
Post a Comment