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

  • Home
  • SEARCH
  • 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 7174813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:08:23+00:00 2026-05-28T16:08:23+00:00

My ultimate aim is to have an inline div on my page which horizontally

  • 0

My ultimate aim is to have an inline div on my page which horizontally scrolls natively (using -webkit-overflow-scrolling: touch) that also snaps.

I can achieve this without -webkit-overflow-scrolling because I have access to the ontouchend event, so I can calculate my snap when that happens, however, to achieve the best possible UX for this feature, I want to use native-like scrolling on this element.

The problem with using -webkit-overflow-scrolling is that using a flick/some force, the div will continue to scroll for a bit after you’ve taken your finger off (i.e. AFTER ontouchend has fired); which means my snap calculates before the scrolling is finished.

Having spent a long time trying to find ways round, I have had no success yet.

In the entire page context, safari fires the onscroll event when a scroll is finished. My question is, is it possible to have this event fire within the context of an element? i.e. have onscroll fire inside <div id="slideShow">?

If not, is it possible to either

(a) Access velocity of a ontouchmove for example, so I could calculate when to run the snap?

or

(b) Emulate -webkit-overflow-scroll: touch (the elasticity and velocity effects).

NOTE: For the sake of example, using iPad w/ iOS5.

  • 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-05-28T16:08:24+00:00Added an answer on May 28, 2026 at 4:08 pm

    The scroll event gets fired on every scrolling container separately, and on iOS only after scrolling has stopped and is complete. You can simply listen for the scroll event on your container.

    Here is an example:

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8" />
            <title>Test Touch Scrolling</title>
            <style>
                body {
                    font-size: 15em;
                }
                #outer {
                    height: 1200px;
                    width: 300px;
                    overflow-x: scroll;
                    -webkit-overflow-scrolling: touch;
                }
                #inner {
                    width: 600px;
                }
            </style>
            <script>
                document.addEventListener("DOMContentLoaded", function() {
                    var list = document.getElementById("outer");
                    list.addEventListener("scroll", function(event) {
                        alert("Scroll has ended for element with ID '" + event.currentTarget.id + "'");
                    });             
                }, false);
            </script>
        </head>
        <body>
            <div id="outer">
                <div id="inner">Some text. And more.</div>
            </div>
        </body>
    </html>
    

    You will see the alert only when you have scrolled the text horizontally, not when the out div has been scrolled.

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

Sidebar

Related Questions

The ultimate goal is to have a div animate down when the button is
I have a text box and a list box, my ultimate aim is to
My ultimate goal is to have a menu that adds a class to the
I made the ultimate laugh generator using these rules. Can you implement it in
I'm using VS2010 Ultimate. Having code: //file IntSet.h #include stdafx.h #pragma once /*Class representing
Here's my ultimate goal in all of this. I have a viewcontroller with a
I'm using Windows Vista Ultimate and today I've installed the Visual Studio 2008 SP1,
I have VS 2010 Ultimate and it's crashing when I open an edmx (Entity
I have an ASP.NET application which will be running in a web server (Windows
My ultimate goal is to have a dry base repository that I can override

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.