Javascript:拖放图片标签 [英] Javascript : drag and drop image tag

查看:154
本文介绍了Javascript:拖放图片标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用javascript拖放图片标签。我知道html5每个元素都可以拖动,但是我想让它在旧的浏览器上工作。我使用javascript做了拖放,除了ie和firefox之外,当鼠标向下时,鼠标移动事件没有反应,除非用户点击它,这就是ie的反应。在firefox上,图像变为半透明和可拖动,但我的代码拖动它。

I wanted to know how to do a drag and drop image tag using javascript. I know html5 each element can be dragged but I wanted to make it work on older browser. I have made the drag and drop using javascript and it worked fine except in ie and firefox when mouse down, the mouse move event didn't react unless the user click it, and that is the reaction of ie. On firefox, the image got changed to semi-transparency and draggable but my code that dragging it.

有谁知道如何解决这个问题?请帮助。

Can anyone know how to solve this problem ? please help.

推荐答案

您是否尝试过jQuery?通过jQuery插件,您可以拖放网站上的每个对象。
jQuery UI:draggable

Have you tried jQuery yet? with the addon jQuery ui you can drag and drop every object on a website.. jQuery UI: draggable

这篇关于Javascript:拖放图片标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆