VISIT AND LIKE OUR PAGE ON FACEBOOK
TAKE A LOOK AT OUR TWEETS ON TWITTER
SUBSCRIBE TO THE JOOMFREAK RSS FEED
VISIT OUR CHANNEL ON YOUTUBE

Account Details

Change your name, email, password or permanently delete your account. Change settings

We offer several ways you can get support from our experts: Support ForumKnowledgebaseNewsletter

Your Forum Posts

No posts to display.

Welcome, Guest
Username Password: Remember me

the slow scroll effect on anchor link
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: the slow scroll effect on anchor link

the slow scroll effect on anchor link 23 Sep 2017 09:40 #10611

To create the slow scroll effect on anchor links
I tried to
enter in jf_salina\scripts\js\template.js
this code

 
// SCROLL //
menuItems = $(".nav ul.nav > li > a");
menuItems.click(function(e){
$(".nav ul.nav > li").removeClass('active');
$(this).parent().addClass('active');
 
var href = $(this).attr("href"),
offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+12;
$('html, body').stop().animate({
scrollTop: offsetTop
},800);
 
e.preventDefault();
});
// \. SCROLL //
 
 


but it does not work

maybe something else is missing?

  • Posts:7
  • maxmak
  • Fresh Boarder
  • OFFLINE
  • Karma: 0

Re: the slow scroll effect on anchor link 23 Sep 2017 15:16 #10612

resolved here is the working code


 
// SCROLL //
topMenu = $(".header-bottom");
topMenuHeight = topMenu.outerHeight();
menuItems = $(".nav ul.nav > li > a");
menuItems.click(function(e){
$(".nav ul.nav > li").removeClass('active');
$(this).parent().addClass('active');
 
var href = $(this).attr("href"),
offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+12;
$('html, body').stop().animate({
scrollTop: offsetTop
},800);
 
e.preventDefault();
});
// \. SCROLL //
 
 

  • Posts:7
  • maxmak
  • Fresh Boarder
  • OFFLINE
  • Karma: 0

Re: the slow scroll effect on anchor link 31 Jul 2019 08:26 #11717

1 Open Google Chrome, type chrome://flags or about:flags in addressbar and press Enter. ...
2 Scroll down a little until you see "Smooth Scrolling" option. ...
3 Click on "Enable" link given under the option and then click on "Relaunch Now" button as shown in 4 following screenshot:
4 That's it MyLowesLife.
Last Edit: 02 Aug 2019 05:39 by Rebecca485.

  • Posts:1
  • Rebecca485
  • Fresh Boarder
  • OFFLINE
  • Karma: 0
  • Page:
  • 1
Time to create page: 0.81 seconds
Saturday 17 August 2019

joomfreak is not affiliated with or endorsed by the Joomla Project or Open Source Matters.
The Joomla logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.