开发者

Can I accept an image that is dragging in HTML?

开发者 https://www.devze.com 2022-12-09 22:41 出处:网络
In many browsers today you can click and drag images. Can I leverage this in any way? 开发者_JS百科Could I receive an event when an image is dragged and dropped on top of another image in the same bro

In many browsers today you can click and drag images. Can I leverage this in any way? 开发者_JS百科Could I receive an event when an image is dragged and dropped on top of another image in the same browser window?


You could use the JQuery Draggable plugin.


I guess you could do it easily with http://script.aculo.us/

I know it works for block elements, not sure about inline though


You could have a look at this DHTML library = DEMO & API


I think this can be done by any Javascript framework (JQuery, Scriptaculous, MooTools, Dojo) as vrinek says. You could also cook up your own Javascript solution, but stable dragging and dropping routines are at the core of most frameworks.

I think whether an element is a block or inline doesn't really matter as you can set the properties for this as well in CSS.


A number of browsers now support the Drag and Drop API, though not Internet Explorer, which (as usual) has its own way of doing things. If you're looking for a cross-browser solution that works today, one of the libraries is still your best bet.

0

精彩评论

暂无评论...
验证码 换一张
取 消