我在将图像设置为可拖动时遇到问题。此代码似乎不起作用:
var thumb = document.createElement("img");
thumb.setAttribute('draggable', "true");
我创建图像并将其附加到 DOM,如下所示: var thumb = document.createElement("img");
thumb.setAttribute('draggable', "true");
thumb.setAttribute('alt', label);
thumb.setAttribute('id', "dhmvseries_" + label);
thumb.setAttribute("dhmvseriesuuid",label);
thumb.ondragstart = thumbDragStart;
thumb.ondragend = thumbDragEnd;
thumb.onmouseover = displayThumbInfo;
thumb.onmouseout = hideThumbInfo;
var thinner = createElement("div", "dhThumbImage dhRounded");
thinner.appendChild(thumb);