How to overwrite the script or smooth scroll functionality in jQuery ~ WordPress ?

So here are the other Queries related to this Topic …..

  1. How to overwrite the jquery script in wordpress ?
  2. jQuery overwrite the script in wordpress ?
  3. How to overwrite the jquery smooth scroll script ?
  4. How to overwrite the wp theme jquery script ?

Here is the way to overwrite the custom script with wordpress theme..

Below is smooth scroll jQuery script that is overwrite the wordpress theme scroll script…

Note :~ Please change the bottom code div element as per yours.

<script type="text/javascript">
jQuery(document).ready(function(){

jQuery("#nst-menu a").click(function(event) {
event.stopPropagation();
var idd = jQuery(this).attr('href').replace( "/", "" );
jQuery('html, body').animate({
scrollTop: jQuery(idd).offset().top  30
}, 1500);


});

});
</script>

Add the script in the footer or using any plugin that can help you to put the script to footer..

There are many plugin like :~ Insert Headers And Footers .

In the Script event.stopPropagation(); function helps you to stop the current action and apply the new action using this script.


I hope this will help you.. and if you still have any other queries then can contact me with the chat box or by using contact form.

Thanks

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat