<script>
$(function () {
$('a[href*=#]:not([href=#])').click(function () {
$(".link").removeClass("active");
$(this).addClass("active");
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
I have this function to make the vertical div scrollable, how do I implement the function to make it trigger only at certain points?