2017-06-17 12 views
0

私は画像1のようにカレンダーを作成しましたので、divにオーバーラップしていたonclick divを作成したいと思います。 00:00から07:00まで8時間開始してください。onclick divを作成する方法jqueryを使って複数のdivに重複する

画像1enter image description here

ので、ちょうどこのことについて私にガイドしてください。よりよい解決策は何ですか?

ドラッグアンドドロップを使用して従業員にイベントを割り当てています。 私は、これはonclickの

$("body").on("mousedown", ".Dropabletd", function() { 
     Myleft = $(this).position().left; 
     Mytop = $(this).position().top; 
     $(this).append("<div class='dynatext label' id='divId'>J'e Divs Created</div>"); 
     $("#divId").css({zIndex: 999,position: "absolute", top: Mytop, left: Myleft, width: '100%', display: "block"}); 
    }); 

を作成DIVされ、それが私のドラッグ機能した画像2 enter image description here 次のように事業部を重ね合わ作成したいと思います。私はそれが私の自己を見つけると、それを学ぶため

function Dragging() { 
    $("body .label").draggable({ 
     revert: "invalid" 
    }); 
    $("body .Dropabletd").droppable({ 
     accept: ".label", 
     drop: function (e, ui) { 
      ui.draggable.appendTo($(this)).css({ 
       top: "0.4em", 
       left: "0.2em", 
       width: "100%", 
       display: "block" 

      }); 
      updateEvents($(this).find('span:last-child').attr("id"), $(this).attr("id")); 
     } 
    }); 
} 

答えて

0

ありませんバディ・ミー・そのために感謝回答します。 変更、ご提案大歓迎ご挨拶ご挨拶ご挨拶ごあいさつ/お問い合わせ

$("body").on("dblclick", ".Dropablesub_td", function() { 
      var hidid = $(this).attr("id"); 
      var Myleft = $(this).position().left; 
      var Mytop = $(this).position().top; 
      var id = $(this).parent().nextAll().eq($(this).parent().index() + 8).attr("id"); 
      if ($(this).parent().index() > 16) { 
       var widths = "100%"; 
      } else { 
       var widths = $(this).parent().width() * 8; 
      } 
      var heights = $(this).height(); 
      $(this).html("<span id='" + hidid.replace(":", "_") + "' class='divId label label-success unselectable' >ABCDEFGHIJKLMNOPQRSTUVWXYZ<span>"); 
      $(this).children().css({zIndex: 999, position: "absolute", top: Mytop, left: Myleft, width: widths, height: heights, display: "block", border: "#808080 solid 2px", color: "black", background: "#00CEB4"}); 
      $(".divId").resizable({ 
       handles: 'w' 
      }); 
      Dragging2(); 
     }); 
関連する問題