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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:56:33+00:00 2026-05-28T13:56:33+00:00

I have a page with jQuery sliders, and moving those sliders sends values to

  • 0

I have a page with jQuery sliders, and moving those sliders sends values to a server. At the same time, the server is queried every second to get current state (for all fields on the page).

So I need to know if a slider (knob) is focused, or otherwise being toyed with, so the ajax code that sets values returned from the server can avoid trying to set the focused slider. Otherwise it bounces around while trying to move the slider.

Current code:

// Called by ajax's return from server, v is the server's value, to set on this slider
function ReportObjectSize (v)
{
    $('#slider_objsize').slider("option", "value", v);
}

and what I’m thinking I need is something like:

function ReportObjectSize (v)
{
  if (!$('#slider_objsize').slider.IsFocused()) // Some way to tell if it's focused
    $('#slider_objsize').slider("option", "value", v);
}

or maybe there’s a better way to do this in general?

  • 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-28T13:56:34+00:00Added an answer on May 28, 2026 at 1:56 pm

    You could check to see if #slider_objsize .ui-slider-handle:focus matches anything:

    if($('#slider_objsize .ui-slider-handle:focus').length)
        // The handle has focus.
    else
        // The handle doesn't have focus.
    

    Demo: http://jsfiddle.net/ambiguous/YKRme/1/

    Note that the :focus selector was added in jQuery 1.6 so the above won’t work with earlier versions of jQuery.

    Alternatively, you could hook into the start and stop events to keep track of when the user starts and stops fiddling with the slider:

    var sliding = false;
    $("#slider_objsize").slider({
        // ...
        start: function() { $('#slider_objsize').data('sliding', true ) },
        stop:  function() { $('#slider_objsize').data('sliding', false) },
    });
    

    Then look at $('#slider_objsize').data('sliding') to see if they’re fiddling with it.

    Demo: http://jsfiddle.net/ambiguous/Gn5cX/

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

Sidebar

Related Questions

I have two jQuery sliders on a page. I would like to fire an
I have a page that has multiple sliders (from http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div ) and since each
I have several jQuery-ui range sliders on a page which add and remove rows
I have a page which contains a jQuery-UI horizontal slider, created using a little
I have a page that uses jQuery with a small glitch. I managed to
I have a jQuery UI Dialog working great on my ASP.NET page: jQuery(function() {
I have a page being loaded with jQuery. The initial load includes 100 records
I have a web page that uses jquery ajax to grab the table markup
I have a page that is using jQuery tabs. Within one of my tabs
I have a page going here that uses jQuery: http://treethink.com/services What I am trying

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.