Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13207

    Hi,

    I have added the necessary CSS to my NEWSCAST theme, so that at the bottom of the site, the words “scroll to top” appears, like the CORONA theme has it here:

    http://www.kriesi.at/themes/corona/

    The only thing, that I don’t know how, is how to achieve this smooth scrolling effect to the top?

    Where can I add it and how?

    Thanks,

    #78259

    Found the solution here:

    http://www.kriesi.at/support/topic/no-author-displayed-on-posts-scrollto-jquery-plugin#post-10174

    If someone needs this for NEWSCAST, too, here is, what I’ve added:

    Open custom.js file, add in line 31

    k_smoothscroll(); //smooth scrolling

    and add after line 787 this code:

    function k_smoothscroll()

    {

    jQuery('a[href*=#]').click(function() {

    var newHash=this.hash;

    if(newHash != '' && newHash != '#' )

    {

    var target=jQuery(this.hash).offset().top,

    oldLocation=window.location.href.replace(window.location.hash, ''),

    newLocation=this,

    duration=800,

    easing='easeOutQuint';

    // make sure it's the same location

    if(oldLocation+newHash==newLocation)

    {

    // animate to target and set the hash to the window.location after the animation

    jQuery('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {

    // add new hash to the browser location

    window.location.href=newLocation;

    });

    // cancel default click action

    return false;

    }

    }

    });

    }

    That causes this nice smooth scrolling to the top effect.

    #78260

    Thanks for posting your solution so others can read!

    Regards,

    Mya

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Smooth scrolling to the top of the site: how to get the smooth scrolling?’ is closed to new replies.