jQuery How to fire the drag event while mouse is still down

前端 未结 4 889
南旧
南旧 2021-01-20 03:23

Ok I\'ve been playing around with this for hours now and still no dice. I\'m creating an interface allowing you to drag and drop an icon(a div with an image inside). I\'m us

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-20 03:35

    The above answers are better because they're discussing doing it the correct way. However, to literally answer your question, you can trigger the mousedown event as such...

    $("div#divID").trigger("mousedown");
    

提交回复
热议问题