spncrmoo of PS Devs
1/6/2017 - 9:49 AM

Dynamic Scroll to element

Dynamic Scroll to element

	jQuery('.r_buttons div').click(function () {
		var destination = jQuery(this).data('trigger');
		scroll_me(destination);
	});

	function scroll_me(target) {
		var destination = jQuery('div[data-location="' + target + '"]');
		var pos = destination.offset().top;

		jQuery('body,html').animate({
			scrollTop: pos - 50
		}, 1000);
	}