Problems with Draggable clones with jQuery UI and IE

Problems with Draggable clones with jQuery UI and IE

Hello i have a function whats makes a dynamic clone of any widget in the document in all the browsers works perfectly excepts in IE, i've tried everything and nothing works any ideas of the solution I'm desspered.


  1. function makeDrag(elmnt){
  2. $(elmnt).draggable({ 
  3. cancel: null,
  4. helper:'clone',
  5. scroll: true, 
  6. scrollSensitivity: 100,
  7. stop: function (event) 
  8. {
  9. if (this.getAttribute('main') == 'true'){
  10. var clnumb = parseInt(this.getAttribute('clone'));
  11. var newIndex = (clnumb+1);
  12. if (getBrowser() == 0){
  13. /*
  14. * The special IE
  15. */
  16. var idClean = $(this).attr('id').substring($(this).attr('clone').length);
  17. clone = add2Doc(this, document);
  18. }else{
  19. /*
  20. * All the normals and
  21. * very usefuls browsers.
  22. */
  23. clone = add2Doc(this, document);
  24. }
  25. clone.setAttribute('clone', newIndex);
  26. clone.setAttribute('id', ((newIndex)+clone.getAttribute('id').substring(1)));
  27. clone.removeAttribute('style');
  28. $(this).removeAttr('new');
  29. $(this).removeAttr('main');
  30. }
  31. $(this).css({position:'absolute', top:event.pageY,left:event.pageX});
  32. if(getBrowser() == 0){
  33. /*
  34. * IE.
  35. */
  36. $(this.parentNode).append(clone);
  37. $(clone).addClass("draggable").addClass("draggedClone");
  38. $(this).appendTo('body');
  39. }else{
  40. /*
  41. * Everybody.
  42. */
  43. $(parent).append(clone);
  44. $(this).appendTo('body');
  45. makeDrag(clone);
  46. }
  47. }
  48. });
  49. }