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 8725875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:08:26+00:00 2026-06-13T08:08:26+00:00

How do you disable the animation that occurs when you use the arrow keys

  • 0

How do you disable the animation that occurs when you use the arrow keys to navigate within a WebView in Mac OS X Lion?

The behavior I’m trying to change appears to be the default for WebViews on Mac OS X Lion. If you load a document into a WebView, set the insertion point, and then use the Up Arrow and Down Arrow keys to navigate, scrolling is not instantaneous — there’s an animation (the view visibly scrolls up or down).

Here’s an Xcode project you can use to see this behavior (just run the application, set the insertion point within the document, and then use the Up Arrow and Down Arrow keys to navigate such that the view scrolls):
http://dl.dropbox.com/u/78928597/WebViewTest.zip

The behavior I’m trying to achieve is what happens in Safari. If you open an html document whose contenteditable attribute is set to true in Safari, you can set the insertion point within the document, and then navigate by using the Up Arrow and Down Arrow keys. When you navigate in this way, scrolling is not animated. The view scrolls instantaneously.

Here is an html document you can use to see this behavior:
http://dl.dropbox.com/u/78928597/WebViewTest.html

Since Safari uses a WebView, and it scrolls instantaneously, it seems like there should be a way to change the scrolling behavior of any WebView, but I’ve had no luck in finding it.

Note that you need to set the insertion point before you navigate with the arrow keys, otherwise you’ll see different behavior.

  • 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-13T08:08:27+00:00Added an answer on June 13, 2026 at 8:08 am

    I think there is a way to do this, but it requires using the Objective-C runtime to modify a private method of a private class.

    To use the Objective-C runtime, add

    #import <objc/runtime.h>
    

    to the #import directives at the top of AppDelegate.m in your Xcode project.

    Scroll animation appears to occur in the private method

    - (BOOL)_scrollTo:(const CGPoint *)pointRef animate:(NSInteger)animationSpecifier flashScrollerKnobs:(NSUInteger)knobFlashSpecifier
    

    of NSClipView.

    We cannot modify the NSClipView object (actually an instance of a private class WebClipView) managed by a WebView through subclassing. Instead, we can use a technique called method swizzling.

    In the @implementation of your AppDelegate class, add

    static BOOL (*kOriginalScrollTo)(id, SEL, const CGPoint *, NSInteger, NSUInteger);
    
    static BOOL scrollTo_override(id self, SEL _cmd, const CGPoint *pointRef, NSInteger animationSpecifier, NSUInteger knobFlashSpecifier)
    {
        return kOriginalScrollTo(self, _cmd, pointRef, 2, knobFlashSpecifier);
    }
    
    + (void)load
    {
        SEL selector = @selector(_scrollTo:animateScroll:flashScrollerKnobs:);
        id WebClipViewClass = objc_getClass("WebClipView");
        Method originalMethod = class_getInstanceMethod(WebClipViewClass, selector);
        kOriginalScrollTo = (void *)method_getImplementation(originalMethod);
        if(!class_addMethod(WebClipViewClass, selector, (IMP)scrollTo_override, method_getTypeEncoding(originalMethod))) {
            method_setImplementation(originalMethod, (IMP)scrollTo_override);
        }
    }
    

    You can read more about what’s happening here in Mike Ash’s article, “Method Replacement for Fun and Profit”; I’m using “Direct Override” method swizzling.

    As a result of this code, scrollTo_override() will be called instead of the WebClipView method -[_scrollTo:animateScroll:flashScrollerKnobs:]. All scrollTo_override() does is call the original -[_scrollTo:animateScroll:flashScrollerKnobs:] with 2 as the animationSpecifier. This seems to prevent scroll animation from occurring.

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

Sidebar

Related Questions

I'm trying to copy Apple's behavior in video playback that allows the user to
does anyone know how to disable that slide animation and just have the action
When i press $('.walk-previous-button') i want to disable the click event until the animation
I am trying to disable the logo in my metro app live tile so
I currently have a scrolling anchor animation that also adds an active class to
I am working on a site that has some jquery based animation, and I
I am trying to create a page that is an endless scrolling loop both
I use a LibraryBar to display some items that have a relationship. Since there
When we navigate to a page that has a panorama control. It shows a
I searching a way how to disable the opening and closing animation of notification

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.