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

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems