0

要素をドラッグ可能とサイズ変更可能の両方にしたいという問題があります。タグを削除した後でも、サイズ変更可能である必要があります。

いくつかのサンプルコード

function  DivMouseDown(id)
{
  try {
    jQuery('#'+ id).draggable({
    opacity: 0.5,
    revert: 'invalid'
    });
  } catch (e) {
    alert ("exception in DIVmouse down: "+ e);
  }

  try {
    jQuery('#droppable').droppable({
      drop: function(ev,ui) {
        var type = jQuery(ui.draggable).attr("tagtype");
        id = jQuery(ui.draggable).attr("id");
        if(document.getElementById(id) != null) {
          var tagStatus = document.getElementById(id).getAttribute('newtag');
          var idTemp = Math.floor(Math.random()*1000); 

          if(tagStatus == 'new')
          {
            //Create new div at the same place and replace this tag status.
            var divId = document.getElementById(id);
            divId.setAttribute('newtag','old'); 
            divId.setAttribute('id',idTemp);
            CreateWorkboardDiv('html comment', type); 
            jsmarty = WMCreateSmartyObject();
            divValue = WMSmartyFetch(jsmarty, 'edit_menu.tpl');
            document.getElementById(divId.id).innerHTML = divValue;
            jsmarty.clear_all_assign();
            //Open Edit box.
            CollabobaTagCreate(divId.id,type,0);    
          }
          else
          {
            //drag on board  div.
            //Nishima-10-09-09
            var position = new Array();
            position['left'] =  document.getElementById(id).offsetParent.offsetLeft + document.getElementById(id).offsetLeft;
            position['top']   = document.getElementById(id).offsetParent.offsetTop + document.getElementById(id).offsetTop;
            position['width'] =  document.getElementById(id).offsetWidth;
            position['height'] =  document.getElementById(id).offsetHeight;
            position['zindex'] =  jQuery('#' + id).css('zIndex');
            var stickyid = document.getElementById(id).getAttribute('stickyId');  
            UpdateStickyPosition(position,stickyid);
            //Nishima-10-09-09
          }
        }
      }
    });
  }
  catch (e)
  {
    alert ("exception in DIVmouse down: "+ e);
  }
}

誰かが、ドロップした後に要素をreziableにする方法を教えてもらえますか?上記のコードタグでは、ドラッグアンドドロップは完全に機能しますが、CHROMEでも要素のサイズを変更できるようにするために何を追加できますか。

ありがとう

4

1 に答える 1

0

この質問を見てください: JQuery UI のカスタム サイズ変更可能なハンドル

于 2009-09-14T06:38:11.473 に答える