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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:15:35+00:00 2026-06-13T09:15:35+00:00

How to set detect with draggable function, When check the box the draggable function

  • 0

How to set detect with draggable function, When check the box the draggable function still not work.

http://jsfiddle.net/KPnRc/

HTML

<div class="drag" style="width:100px; height:100px; background:blue;"></div>
Lock:<input name="lock" id="lock" type="checkbox" value="0" />

JS

if($('#lock').is(':checked') == true){

    $(".drag").draggable();

}
  • 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-06-13T09:15:36+00:00Added an answer on June 13, 2026 at 9:15 am

    You need to bind your javascript in an onchange event
    Here is a fiddle example http://jsfiddle.net/KPnRc/6/

    $(document).ready(function () {                 // When the document is ready
        $('.drag').draggable();                     // Initialize the .drag element with draggable
        $('#lock').on('change', function (evt) {    //Bind a function to the checkbox
            if($(this).is(':checked') == true) { //if checked then disable draggable
                $('.drag').draggable('disable');
            }
            else {                                  //else enable draggable.
                $('.drag').draggable('enable');
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a simple way to detect when a set insert does not occur
Cannot Detect Margin with JavaScript DOM While It Is Set in CSS: <div> <div
How can I detect if a device has 'do not keep activities' set in
I'd like to not only detect transition support, but set the correct prefix with
I wanna a function to detect whether VIM has enabled 'set nu' feature. How
I am trying to detect whether an integer was set, and if not, skip
I've got a timer set up to detect if the mouse is over a
I've set up a BOOL called isUsingiPad to detect when my user is using
For some reason I can't detect I can't set a z index for any
I'm trying to detect keyboard input and if the arrow keys are pressed, set

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.