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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:31:32+00:00 2026-05-28T03:31:32+00:00

I detect the distance of a reader with a webcam, for that i get

  • 0

I detect the distance of a reader with a webcam, for that i get a value between 0 and 1. That value i map to a fontsize, in this case 13 and 25.
I want it to effect the fonth smooth over time. It the moment it does not go smooth.
And if i use the .animate then it hardly doesn’t work, i think this is because it get’s a new value for the distance every 100ms and jquery doesn’t now how to animate something that get’s changed before a animation can even finish.

var fontSize = map(distance, 0, 1, 13, 25);
$("#section_1").css({'font-size': fontSize});
//$("#section_1").animate({'font-size': fontSize});

function map(value,  istart, istop, ostart, ostop) {
     return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
}
  • 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-28T03:31:33+00:00Added an answer on May 28, 2026 at 3:31 am

    If the value is changing before the animation can finish and this is leading to a concurrent call to .animate(), just call the .stop() method first. The .stop() method stops any active animations on the selected objects:

    var fontSize = map(distance, 0, 1, 13, 25); 
    $("#section_1").stop().animate({'font-size': fontSize});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to detect faces on camera previews. I saw this example in OpenCV
I want Detect the largest number in inputs and done alert for it, How
I want to detect if mytable view has been scrolled, I tried all touch
Does the system detect a difference between the keyboard done key and the keyboard
I use this to functions as a base of my tracking algorithm. //1. detect
I'm trying to detect the distance the mouse has moved, in pixels. I am
Can the iphone detect its movement in terms of distance? Would one be able
Valgrind detect an invalid write of size 1 in this piece of code. In
I have a tag within a HTML5 document. How can I detect the distance
EDIT: I want to detect the destination location contrast with my current location to

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.