[英]how to create onclick div that overlapping on multiple divs using Jquery
我是按照图片1创建日历的,所以我的问题是我想创建在div上重叠的onclick div,即如果单击00:00列而不是创建div,则从00:00到07:00进行8小时。
因此,请指导我。 有什么更好的解决方案
已经使用拖放为员工分配事件。 我想创建重叠的Div,如下图2所示 这是onclick div创建的
$("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"});
});
那就是我的拖动功能。
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"));
}
});
}
没有哥们回答我,谢谢,因为那是因为我找到了我自己并学习了它。 有任何更改,建议最受欢迎尊敬的先生/女士
$("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();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.