$("#photoAlbum").on("mouseenter", ".imagecontainer", function () {
$(this).find('.controlbar').show("slide", { direction: "down" }, 1000);
}).on("mouseleave", ".imagecontainer", function () {
$(this).find('.controlbar').hide("slide", { direction: "up" }, 1000);
});
.controlbar
默认隐藏
在 ajax 请求之后,.imagecontainer
div(s)被附加到#photoAlbum div,因此我使用的原因.on()
不仅仅是.hover(function() {}, function(){})
HTML,drop-backdrop 是绝对定位的。
<div id="photoAlbum" class="tabcontent">
<div id="drop-backdrop">
<div class="text">Drag files here to upload</div>
</div>
<canvas id="drop-target"></canvas>
<div class="imagecontainer"><div class="controlbar" style="visibility: hidden; "><img src="/TreeView/images/delete.png" width="16px" height="16px"></div><img src="/Content/photoAlbums/9/3/539695_t.jpg"></div></div>