mardi 26 août 2014

HTML5 Draggable not work for Input, Button, etc


Vote count:

0




I'm working on a project that has draggable elements on the page so you can drag which element wherever you want. All elements that are draggable have "draggable=true" attribute.



  • note: I use jQuery but not jQuery UI Draggable!


I have this function in my plugin to handle drag start event :



function onDragStart(e, element) {
if (this.settings.handle && !this.isHandle) {
return false;
}
e.preventDefault();
setDataTransfer(e, true);
element = $(e.target);
draggingElement = element.addClass(this.settings.dragging);
this.itemIndex = draggingElement.index();
if (typeof this.settings.start == 'function') this.settings.start.call(this, draggingElement);
}


It works all other type of elements such as div, h1, p, section, header etc. but doesn't work for some elements like , button, etc..


How can I make those elements draggable also?



asked 1 min ago







HTML5 Draggable not work for Input, Button, etc

Aucun commentaire:

Enregistrer un commentaire