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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:47:01+00:00 2026-05-26T01:47:01+00:00

I’m trying to save the mouse Y coordinates to the variable startPosition ONLY every

  • 0

I’m trying to save the mouse Y coordinates to the variable startPosition ONLY every 100ms while .mousemove is active, while the mouse button is held(mousedown), my code isn’t working for me, i’m assuming it’s wrong? Can someone help me figure this out?

    $(document).mousemove( function (e) {
        gesturesY = parseInt(e.pageY, 10);
        startPosition = setInterval(gesturesY, 100);
    });

EDIT:
I think this might be a whole new question? Sorry for any confusion, below is clarification for my jumbled mess of a question.
Here we go:

http://jsfiddle.net/nicktheandroid/PCgFK/1/

This JSfiddle allows you to grab the page in the scrollbox and fling it up or down, like a touchscreen phone. Right now, if you grab the page(in the scrollbox area) and move your mouse up(causing the page to scroll down), then release the mouse button, the velocity will kick in and it will jump the page a little. It’s there for when you actually grab the page and flick it up or down to scroll the page, it makes it come to a nice slow and steady stop. If the person doesn’t flick, but instead just drags the page and then holds the mouse steady and releases the mouse button, it jumps, like I stated above. I’m trying to get rid of that jump when the person grabs and drags the page, then while the mouse is still, releases the mouse button.

I thought that by updating the startPosition every 100ms or so, that it would eliminate that jump but still keep the velocity slow down from flicking the page up or down. I’m pretty close to being done with this, but there’s still the problem that i just stated. Someone else helped me out with adding the velocity, and in the script there’s a variable called velocityCheckWait that I think is doing the opposite of what I wanted it to do.

Sorry for any confusion, and thank you to anyone who could dedicate any time to helping me out.

  • 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-26T01:47:02+00:00Added an answer on May 26, 2026 at 1:47 am

    There isn’t anything to really do what you want; the best way to emulate this is the code below:

    var currentPosition = 0;
    
    $(document).mousemove(function (e) {
        currentPosition = e.pageX;
    });
    
    setInterval(function () {
        startPosition = currentPosition;
    }, 100);
    

    This updates the mouse position constantly, but only updates it to the variable you want every 100ms (in the meantime, its updating the other variable currentPosition.

    If you’re only wanting to update the position every 100ms due to performance worries, firstly, I’d double check you aren’t underestimating the power of computers these days. If it is a valid concern however, the following code will help you:

    var startPosition = 0;
    
    $(document).mousemove(function (e) {
        startPosition = e.pageX;
    });
    
    setInterval(function () {
        // read in startPosition and do your **intensive** task here.
    }, 100);
    

    In here, startPosition is been updated all the time, but you’re only executing your interval every 100ms.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post

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.