Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #15014 > unrolled thread

How to set draggable ="true" through Javascript ?

Started by"til@k" <tilaka00@gmail.com>
First post2012-07-11 00:07 -0700
Last post2012-07-11 14:06 +0300
Articles 3 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  How to set draggable ="true" through Javascript ? "til@k" <tilaka00@gmail.com> - 2012-07-11 00:07 -0700
    Re: How to set draggable ="true" through Javascript ? camilleriluke <luke.c.mail@gmail.com> - 2012-07-11 01:36 -0700
      Re: How to set draggable ="true" through Javascript ? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-07-11 14:06 +0300

#15014 — How to set draggable ="true" through Javascript ?

From"til@k" <tilaka00@gmail.com>
Date2012-07-11 00:07 -0700
SubjectHow to set draggable ="true" through Javascript ?
Message-ID<fa548f66-6771-4edc-8723-58fd770c9648@googlegroups.com>
hii ,

 I am creating a div dynamically through javascript . so i need to set property through only. Can anybody tell how to set the draggable ="true" for a div through javascript. I tried with this not working properly.
(htmlElement.draggable = true;)

Plz help 
Thanks in Advance

[toc] | [next] | [standalone]


#15015

Fromcamilleriluke <luke.c.mail@gmail.com>
Date2012-07-11 01:36 -0700
Message-ID<07a6db87-02fa-4327-b0da-a23650f0f65b@googlegroups.com>
In reply to#15014
var div = document.createElement('div');
div.draggable = true;

// the value of the div variable should be: <div draggable="true"></div>


On Wednesday, July 11, 2012 9:07:44 AM UTC+2, til@k wrote:
> hii ,
> 
>  I am creating a div dynamically through javascript . so i need to set property through only. Can anybody tell how to set the draggable =&quot;true&quot; for a div through javascript. I tried with this not working properly.
> (htmlElement.draggable = true;)
> 
> Plz help 
> Thanks in Advance

[toc] | [prev] | [next] | [standalone]


#15017

From"Jukka K. Korpela" <jkorpela@cs.tut.fi>
Date2012-07-11 14:06 +0300
Message-ID<jtjmnr$702$1@dont-email.me>
In reply to#15015
2012-07-11 11:36, camilleriluke wrote:

> var div = document.createElement('div');
> div.draggable = true;

That would technically set the attribute, but dragging and dropping is 
more complicated, with browser-dependent oddities; see

http://www.htmlgoodies.com/html5/tutorials/html-5-drag-drop-basics.html
https://developer.mozilla.org/En/DragDrop/Drag_Operations

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web