Grow your CSS skills. Land your dream job.

Scroll to top slider

  • # April 30, 2010 at 5:02 pm

    Hi all,

    I got stuck at the moment with a scroll to top slider, It slides fine but when i click the scroll to top div it’s stay on top and i can’t scrll down

    can someone help me out?

    amorz

    Code:
    var amorzScroll = null;

    $(window).scroll(function () {
    var scrollTop = $(document).scrollTop();
    scrollTop = parseInt(scrollTop);

    var offset = amorzScroll+scrollTop+”px”;
    $(“#toplink”).animate({top:offset},{duration:700,queue:false});

    $(‘#toplink’).click(
    function (e) {
    $(‘html, body’).animate({scrollTop: ’0px’}, 800);
    }
    );
    });

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".