Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

jquery smooth scrolling

  • 29-04-2009 1:42pm
    #1
    Closed Accounts Posts: 184 ✭✭


    I'm trying to implement a script to scroll smoothly to inline links on my site, I'm having no success with this. Anyone shed some light on this?
    $(document).ready(function(){
    $('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) {
    var targetOffset = $target.offset().top;
    $('html,body')
    .animate({scrollTop: targetOffset}, 1000);
    return false;
    }
    }
    });
    });
    


Comments

  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    theres an easy to use plugin that does this - why dont u use that ?


Advertisement