I have a page template like this:
<div class="page-wrapper">
<header class="header-5">
<div class="container">
content
</div>
<div class="background"></div>
</header>
<section class="content-3">
<div class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
content
<a class="control-btn" href="#"> </a>
</div>
</div>
<div class="container">
When <a class="control-btn" href="#"> </a>
is clicked, I want it to scroll to the last <div class="container">
(the last line in the code snippet).
With this jQuery, it scrolls to the first div.container
(toward the top of the snippet):
$('.control-btn').on('click', function() {
$.scrollTo($(".container"), {
axis : 'y',
duration : 500
});
return false;
});
How can I get it to scroll to the next div.container
(the last one in my code example)?
Note: There are other div.container
elements further down -- this isn't the "last" one on the page.