Using jQuery we can easily scroll to the required div by using any event like click , Mouse over etc. Same jQuery Function can be used to scroll multiple Divs. No change required in function during addition or removal of any div to scroll. Small Snippet jQuery's ScrollTo function alternative. See Demo for its Working and code
jQuery Function Used. Complete code in demo link
$(document).ready(function (){
$(".click").click(function (){
var pos = $(this).attr("position");
$('html, body').animate({
scrollTop: $("#"+pos).offset().top}, 2000);
});
});
0 comments :
Feel free to leave comment if you like above widget, have any questions or just say Hi! :)