Community Forums › Forums › Archived Forums › General Discussion › Smooth Scroolling Links on Altitude pro based on home page scroolling code
- This topic has 5 replies, 3 voices, and was last updated 9 years, 2 months ago by Exkalibur85.
-
AuthorPosts
-
August 9, 2015 at 9:30 am #161843Exkalibur85Participant
Hello:
On Altitude Pro the links use the smooth scrooling.
Are there any way to use that code so we can apply the smooth scrooling to all the links inside the pages of the website, and not only at the home page?
Thank you.
(Here is the code of the homepage.php that adds the smooth scrooling.)
//* Enqueue scripts
add_action( 'wp_enqueue_scripts', 'altitude_enqueue_altitude_script' );
function altitude_enqueue_altitude_script() {wp_enqueue_script( 'altitude-script', get_bloginfo( 'stylesheet_directory' ) . '/js/home.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );}
August 9, 2015 at 6:59 pm #161875JeffMemberYou should be able to apply the smooth scrolling site wide by cutting this code from the front-page.php file
//* Enqueue scripts add_action( 'wp_enqueue_scripts', 'altitude_enqueue_altitude_script' ); function altitude_enqueue_altitude_script() { wp_enqueue_script( 'altitude-script', get_bloginfo( 'stylesheet_directory' ) . '/js/home.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true ); wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true ); }
and then pasting it in the functions.php file.
Hope that helps!
August 9, 2015 at 7:12 pm #161876JeffMemberSorry! After posting my previous post, I just realized that there's going to be more you'll have to do to get this to work site wide.
The front-page.php file creates the widget areas with the appropriate ID's (front-page-1, front-page-2, etc.) and your navigation bar links are setup for each of the sections on the front page so they won't work on additional pages.
Off the top of my head right now, I'm not for sure how to setup the other pages. I'll do so playing around here over the next couple days and try to find a complete solution for you. Or perhaps someone else will chime in before.
Anyways, hope that makes sense. Sorry for my premature post. Good luck.
August 10, 2015 at 4:14 am #161901Exkalibur85ParticipantAugust 10, 2015 at 5:16 am #161906August 16, 2015 at 4:11 am #162498Exkalibur85ParticipantHi Guys. Any help, the smooth scrolling still not working just adding the code at functions.php. I create the <div id=”milinked area” /></div> and a link to it, but is not working with the smooth scrolling efect.
Any help is really welcome. Thank you.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.