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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:36:54+00:00 2026-06-06T15:36:54+00:00

I make an element on a page with mouse click somewhere on the page

  • 0

I make an element on a page with mouse click somewhere on the page by inputting something like this to the document:

$("#sheet").append('<input class="elements" id="Button12" type="button" value="button" />');

But I don’t want to be clickable for a while,so I can disable it:

$(".elements").prop('disabled', true);

But the problem is, I want this element to be draggable so I can move it on the page, I tried this but doesn’t work:

$('.elements').draggable
({
    containment: "#frame",
    grid: [5,5]
})

How can an element be draggable while it is unclickable?

  • 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-06T15:36:56+00:00Added an answer on June 6, 2026 at 3:36 pm

    Usually better with form elements when animating, or dragging to wrap in another container. In this case insert another element positioned absolute and higher z-index that fills the wrapping container, and covers the disabled input since mouse events won’t register on the disabled element. By covering the input, mousedown for drag will occur on the inner span.

    var input='<span class="element_wrap"><span class="element_wrap_inner"></span>';
        input+='<input class="elements" id="Button12" type="button" value="button" disabled+"disabled" /></span>';
    
    $("#sheet").append(input);
    
    $('.elements_wrap').draggable({
        containment: "#frame",
        grid: [5,5]
    });
    

    Apply appropriate css. When enabling the input, hide or remove the inner span

    DEMO: Using click on a disabled checkbox for simplicity http://jsfiddle.net/KtP5K/

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

Sidebar

Related Questions

If I have something like this: <p>Element<p> <iframe src = otherPage.html style = width:100%;height:100%>
How can I make a div element move up and down the page when
I would like to position a div withing another element but make it stay
If I subscribe dblclick() and click() for a DIV element and make double click
In our page,we often use the javascript based animation to make the element move/resize,most
I want to load content of my page inside a div element using this
<body onload=document.getElementById('menuTest').style.removeAttribute('display')> This is the code I'm using. Basically I'm trying to make an
Any idea to make an element in the page full screen? For example,a div
I have a Link element in the Master Page. This element is initially invisible.
If you visit this page in Chrome: http://www.immigrationconsult.org/contact.php And Inspect Element on the page,

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.