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

The Archive Base Latest Questions

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

Here’s my code: tripper = 2; $(#topheader).mousewheel(function(event, delta) { if (tripper == 2){ startPlace

  • 0

Here’s my code:

        tripper = 2;
    $("#topheader").mousewheel(function(event, delta) {
        if (tripper == 2){
            startPlace = $("#content").scrollLeft();
            startCounter = something;
            tripper = 1;
        } else {
            currentPlace = $("#content").scrollLeft();
            if(startCounter < 100){ // milliseconds
            distanceMoved = currentPlace - startPlace;
                if(distanceMoved > 100){
                    slideRight();
                } else if(distanceMoved < -100){
                    slideLeft();
                }
            } else {
                tripper = 2;
            }
        }
    }

What is the proper way to check if 100 milliseconds has passed sense the first time through this function? In the 5th line of code i have the variable “something” which needs to be replaced with a counter of some sort. Or maybe I’m going about this in an entirely wrong way. Suggestions?

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

    You can instantiate a “Date” object like this:

    var then = new Date();
    

    Later you can make another one:

    var now = new Date();
    

    Subtraction gives the difference in milliseconds:

    var elapsed = now - then;
    

    (The coercion from “Date” to “Number” is implicit when the two date values appear on either side of the subtraction operator. The conversion is just like calling “now.getTime()”.)

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

Sidebar

Related Questions

Here is my javascript code for a cursor focus function to go to username
Here is my code, which takes two version identifiers in the form 1, 5,
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
Here's some of my production code (I had to force line breaks): task =
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here's my function: static Map AddFormation(Map _map, Tile tile, int x, int y, int
Here is a great article about GC may occur at unexpected point of code
here a a piece of code that is supposed to loop over and over
Here is my code: PtyView *v = [[PtyView alloc] init]; [v sendData([charlieImputText stringValue])]; in
Here is a synopsis of my code which is a moderately complex WinForms GUI.

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.