如何用鼠標移動圖像? onmousedown
和onmousemove
是處理權利的事件嗎?鼠標向下,鼠標移動和鼠標事件的圖像?
<html>
<body>
<script type="text/javascript">
funcion good()
{
document.getElementById("omna");
document.getElementById("omna).style.position="absolute";
document.getElementById("omna").style.top=somevalue; 'these keeps changing
document.getElementById("omna").style.left=somevalue; ' these keeps changing
}
</script>
<img id="omna" src"/something.jpg" onmousedown="highlight() onmousemove="good()" onmousedown="stop()"> 'not working
</body>
</html>
如何在圖像上使用mousedown
事件?並與mousedown
事件(我的意思是與圖片上的mousedown
),它應該在JavaScript中不斷運行mousemove
事件函數,並且當mouseup
甚至發生它應該停止。 如何連續循環mousemove
事件?無法解決問題。我在google上找到了一些解決方案,但無法弄清楚它的語法和全部。如果您以某種方式發佈相同的內容,請解釋我的解決方案。
很抱歉忘記告訴你我的mousedown
和mousevents
不工作。有人建議使用錨標籤,那是好的?爲什麼mouseevents
正在爲圖像工作?