top of page

Smooth Scroll In JS and jQuery

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • Aug 31, 2020
  • 1 min read

Updated: Nov 11, 2020


jQuery(document).ready(function () {
  jQuery('.processreachfind').click(function(e){
      e.preventDefault();
      jQuery('html, body').animate({
      scrollTop: jQuery(".find-section").offset().top -50
      }, 500);
    });
});



Method 2



Sample URL 
	/*Window Load*/

	jQuery(window).on('load', function(){

	  setTimeout(function(){ 
	    var tab = window.location.search;
	    if(tab){
	      var tabs   = tab.replace('?', '');
	      var scroll = tabs.split('=');
	      console.log(scroll[1]);
	    	jQuery('html, body').animate({
	      		scrollTop: jQuery('#'+scroll[1]).offset().top -80
	      	}, 500);

	    }
	  }, 1500);


	});
	/*End Window Load*/


Recent Posts

See All
Google ReCAPTCHA with AJAX

This is how you can pass on AJAX .js var userdata = { 'action' : 'signin_member', 'username' : jQuery('#user_name').val(), 'password' :...

 
 
 
Self Invoking Function jQuery

The function starts with (function ($) { and you can use your own code inside it (function ($) { jQuery(document).ready(function () {...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page