• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Digital Pro – Remove Smooth Scrolling From Button Click In Front Page 1 Widget Area

This tutorial enables you to remove the smooth scrolling effects from the front page widgets in Digital Pro. Based on this question from a client:

When I click on the buttons on the front-page widgets, the whole page is scrolling to the next section. When I click on the navigation on the top right it’s jumping to the section. Would it be possible to have the same effect?

The Solution

If you look inside the js/front-page.js file in Digital Pro, you’ll find some jQuery for scrolling effects between lines 41 – 59.

You can remove or comment out this jQuery.

$( '.front-page-1 a[href*=#]:not([href=#])' ).click(function() {

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
	}, 750 );

	return false;

			}
		}

	});

When you click the button in the front page 1 widget area, it should work the same as the nav menu links without the smooth scrolling.

Why did the scroll links stop working?

Updated files

Digital Pro Theme

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.