0

Hi I am currently using this minified plugin from godswearhats To call the plugin

$('#em_1').rotatable();

Here is my html code

<div class="draggable paragraph ui-draggable ui-resizable active resizableborder "id="em_1">
    asdasd123123
    <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-n active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-w active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-s active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-e active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-nw active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-ne active-resizable" style="z-index: 90;"></div>
    <div class="ui-resizable-handle ui-resizable-sw active-resizable" style="z-index: 90;"></div>
    <div class="ui-rotatable-handle ui-draggable active-rotatable"></div>
</div>

Now there is function in my code that removes this part because i need to.

 <div class="ui-rotatable-handle ui-draggable active-rotatable"></div>

And after that function i need to recreate the rotatable handle. I am able to reappend the handle but when calling $('#em_1').rotatable(); the events are lost. I think there is a problem with the plugin itself but I don't know how to fix it.

Here is the link to the plugin https://raw.githubusercontent.com/godswearhats/jquery-ui-rotatable/master/jquery.ui.rotatable.min.js

5
  • $('#em_1').rotatable(); and $('#em_').rotatable(); are different (note the 1). Apr 25, 2014 at 4:31
  • 1
    Also, you can use api.jquery.com/detach on the element you want 'removed' and put it back later with the events intact. Apr 25, 2014 at 4:33
  • @HamzaKubba oops it was a typo sorry. Edited my question.
    – Kiel
    Apr 25, 2014 at 4:36
  • 1
    See my note about detach, I believe it solves your problem? You detach that ui-draggable div and readd it later when you want it. Apr 25, 2014 at 4:38
  • Hey that solved my problem thank you! Please post that so I can mark that as the answer :)
    – Kiel
    Apr 25, 2014 at 4:43

1 Answer 1

1

You can use $(elem).detach() (http://api.jquery.com/detach) on the element you want 'removed' and put it back later with the events intact.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.