Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:06:12+00:00 2026-06-14T02:06:12+00:00

I want to create an animation to scroll the page smoothly when clicking on

  • 0

I want to create an animation to scroll the page smoothly when clicking on anchor links, just like jQuery.ScrollTo plugin (http://demos.flesler.com/jquery/scrollTo/) does it.

I tried making it using YUI 2.x Animation utility, by animating the value of the property document.activeElement.scrollTop. It works on webkit only :'( – on the other browser, nothing happens – not even an error is raised.

goToAnchor = function(e, id) {
    var targetToGo = Dom.get(id),
        scrollToTarget = new Animation(document.activeElement,
            {
                scrollTop:
                {
                    from: document.activeElement.scrollTop,
                    to: targetToGo.offsetTop
                }
            },  1,  Easing.easeOut
        )
    Event.preventDefault(e);

    scrollToTarget.animate();
}

What I’d like to know is if there’s a plugin that does this for YUI 2.x or how to do a cross browser compatible code to do so.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:06:13+00:00Added an answer on June 14, 2026 at 2:06 am

    You need to keep in mind that depending on browser you might need to scroll the html or the body element.

    (practially, you need to scroll both to be sure)

    Also at http://developer.yahoo.com/yui/animation/#scroll i see

    var element = document.getElementById('test');
    var myAnim = new YAHOO.util.Scroll(element, {
        scroll: {    
            to: [ 500, test.scrollTop ]
        } 
    });
    myAnim.animate();
    

    Maybe that is what you are looking for (still you will have to animate both html and body)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a <div> animation very much like this site: http://www.weareinstrument.com/about/ .
I want to create an animation which looks like flashing lights. jsFiddle I want
I want to create a slide-down animation, like in the image in the link.
I want to create animation on the button. Button has its image. When clicking
i want to create a childrens book like this one: http://www.youtube.com/watch?v=Sc1APRfP2o8 and i wanted
I want to create scroll behavior like what can be found here . If
i want create image animation , i have 50 images with png format now
I have a problem with moving animation. I want to create animation which start
I have a problem with switching images in android. I want to create animation
I want to create an animation effects which sort of shakes an image on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.