Smooth scroll down/up

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Oct 28, 2014 10:11 am
Reply with quote
Report this post
Is it possible to have a smooth scroll up/down? For example if you hit 'Back to top' in the bottom left corner.

Or for example over here. I have 2 buttons, 'werkwijze' and 'kosten' and they are anchorlinks in the text. I want a smooth scrolling when you hit one of those buttons.

tnx in advance.
User avatar
Expert Boarder

GK User
Tue Oct 28, 2014 12:07 pm
Reply with quote
Report this post
Hi,
Smooth scrolling request extra JS , which are not included in all GK templates.
It means that you have to use additional plugin to get this code, search on JED - this is the only way.
Or if you have skills you can grab from another our template and insert into Magazine template code.
User avatar
Platinum Boarder

GK User
Tue Oct 28, 2014 1:40 pm
Reply with quote
Report this post
done, just picked
Code: Select all
// smooth anchor scrolling
   jQuery('a[href^="#"]').on('click',function (e) {
      e.preventDefault();

      var target = this.hash,
      target = jQuery(target);
      if(target.parent() !== jQuery('#gkStyleArea')) {
         jQuery('html, body').stop().animate({
            'scrollTop': target.offset().top
         }, 1000, 'swing', function () {
            window.location.hash = target.selector;
         });
      }
   });


from gk.scripts.js from another template and added it. Works perfectly fine now :)
User avatar
Expert Boarder

GK User
Thu Apr 16, 2015 7:58 pm
Reply with quote
Report this post
Hey guys,

I'm doing the same here, with template Events.

I allready have that code on gk.scripts.js

But i need some help on the html. For example, in Jonh template we have ~

Code: Select all
<p><a class="gkScrollDown gkAnimate reverse" href="#my-works">Scroll Down</a> <img class="gkHeaderBg" src="images/demo/header/header1.jpg" alt="John S." /></p>


So in my site i need to go down 300px what should i input instead of: href="#my-works"

Thanks in advance
User avatar
Senior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.