Drag and Drop is not working in Tizen Device

Drag and Drop is not working in Tizen Device

BY 02 Apr 2015 Web Application Development

Hi all,

I am trying to implement Drag and Drop functionlaity for my app.When I tried some sample code, it is working fine in the web simulator(chrome), but it is not working in tizen device and emulator.when ever i long press it , i am getting an context popup option as drag and drop.But my requirement is ,I dont need a context pop up for drag and drop instead it has to drag. Please let me know how to do that?

Sample code used :

<!DOCTYPE HTML>
<html>
<head>
<style>
#div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;}
</style>
<script>
function allowDrop(ev) {
    ev.preventDefault();
}

function drag(ev) {
    ev.dataTransfer.setData(“text”, ev.target.id);
}

function drop(ev) {
    ev.preventDefault();
    var data = ev.dataTransfer.getData(“text”);
    ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>

<p>Drag the W3Schools image into the rectangle:</p>

<div id=”div1″ ondrop=”drop(event)” ondragover=”allowDrop(event)”></div>
<br>
<img id=”drag1″ src=”img_logo.gif” draggable=”true” ondragstart=”drag(event)” width=”336″ height=”69″>

</body>
</html>

 

Thanks in advance.

Sampath

 

Written by