Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以这是我正在使用的代码,我需要#div2、#div3 和#div4 保持在#div1 之下。
$(function() { $( "#div2, #div3, #div4" ).draggable({ stack: "#div2, #div3, #div4" }); });
我试过 z-index 但它没有用。
您可以使用stopevent 循环遍历元素并调整 z-indexes
stop
$( "#div2, #div3, #div4" ).draggable({ stop: function() { /* adjust z-indexes here*/ } })