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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:47:19+00:00 2026-06-05T06:47:19+00:00

I have some div’s and have applied resizable & draggable methods to it. But

  • 0

I have some div’s and have applied resizable & draggable methods to it. But when i apply the selectable method, it does not emit the “ui-selected” into the class of the DIV.

Pls suggest the workaround for this problem.

Below is the code:-

<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
<link href="development-bundle/themes/base/jquery.ui.resizable.css" rel="stylesheet" type="text/css" />
<link href="development-bundle/themes/base/jquery.ui.theme.css" rel="stylesheet" type="text/css" />

<style type="text/css">
    .dragClass {
            font-family: Tahoma, sans;
            color: black;
            background: orange;
            border: 1px solid orange;
            width: 10em;
            height:auto;
            padding: 0.5em;
        }

    textarea {
            font-family: inherit;
            color: inherit;
            background: transparent;
            border: 0;
            width: 100%;
            height: 100%;
            resize: none;
        }
</style>

<script type="text/javascript" language="javascript">
    $(function () {
        $(".dragImgClass").draggable({ delay: 100, containment: "#ParentDIV", scroll: false });
        $(".dragClass").draggable({ delay: 100, containment: "#ParentDIV", scroll: false });
        $(".dragClass").resizable();
        $(".dragClass").selectable();

        $(".dragClass").on("click", function (event) {
            // Don't do anything if already editing                
            if ($(this).find("textarea").length) return;

            var $this = $(this); //get current obj.

            // Replace paragraph with textarea
            var $p = $this.find("p");
            var $txtar = $('<textarea/>').val($p.text());
            $p.replaceWith($txtar);
            $txtar.focus();                
        });

        $(".dragClass").on("blur", "textarea", function () {
            // Replace textarea with paragraph
            var $txtar = $(this);
            var $p = $('<p/>').text($txtar.val());
            $txtar.replaceWith($p);
        });

    });  //End of DOM Ready

    function getHTML() {
        var dv = $('#ParentDIV');
        var dvCont = $('#dvHtml');
        dvCont.css('border','2px solid red').text(dv.html());
    }

</script>

Below is the HTML Content:-

<input id="Btn1" type="button" onclick="getHTML();" value="Extract HTML" />
<div id="dvHtml"></div>
<br /><br />
   <div id="ParentDIV" style="margin-left:200px; width:800px; height:500px; background:lightgray;">                    
       <div class="dragClass"><p>Drag me around!</p></div>
       <br /><br />
       <div class="dragClass"><p>Drag me around! also</p></div>        
       <br /><br />
       <img class="dragImgClass" src="logo3.JPG" />
       <br /><br />
       <img class="dragImgClass" src="logo4.JPG" />        
   </div>

Here is jsFiddle of my problem

  • 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-05T06:47:21+00:00Added an answer on June 5, 2026 at 6:47 am

    i can see in firebug that your Selectable div emits proper css like this "dragClass ui-draggable ui-resizable ui-selectable" inspect it in firebug/IE developer tools or any other tool it is there
    here is a jsfiddle to your problem
    i can see the selectable class applied to the div clearly in firebug.

    EDIT

    to disable draggable & resizable you can do it like

    $('.dragclass').draggable( 'disable' );
    $('.dragclass').resizable( 'disable' );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a link which animates some div 's height when its hovered, but
I have some HTML that I insert into a div using javascript. But it
I have some AJAX that refreshes my page but also makes the div that
In my case, i have some div and img tags. I am applying draggable
I have some problems resizing a div with ID mask which I use to
I have some divs: <div class=A>Target</div> <div class=A B>NotMyTarget</div> <div class=A C>NotMyTarget</div> <div class=A
I have some html snippet <div id=title>This is title<span id=close>X<span><div> The width of this
I have 3 radio buttons which hide/show some div's. The radio buttons are getting
I have some mark-up like so: <div class=slideshow> <div class=slide style=display:block;></div> <div class=slide style=display:none;></div>
I have some HTML like this: <div id=MyDiv> <div class=Class1> <div class=SClass1></div> </div> <div

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.