Note that there are some explanatory texts on larger screens.

plurals
  1. POmy solution for drag drop functionality is not working in firefox
    primarykey
    data
    text
    <p>I'm implementing simple drag and drop functionality into my website. It works fine as per drag and drop of image concerns. However, now I want to save dropped image into the server. For that I have included data regarding image in view as hidden elements, to access this data in jQuery I need dropped image id. I have tried getting this from following code it work's great in chrome but doesn't in firefox please help : </p> <p>code: </p> <pre><code> view &lt;!-- dragable image --&gt; &lt;a href="#?w=976" rel="popup1" id="&lt;?=$album['album_id'].'-'.$data-&gt;content_id?&gt;" class="poplight album_photos"&gt;&lt;img id="&lt;?=$album['album_id'].'-'.$data-&gt;content_id?&gt;" draggable="true" ondragstart="drag(event)" ondragover="allowDrop(event)" alt="" src="&lt;?=$imagePath?&gt;"&gt;&lt;/a&gt; &lt;input type="hidden" id="&lt;?='wall'.$data-&gt;content_id?&gt;" value="&lt;?=$data-&gt;wall_id?&gt;"/&gt; &lt;input type="hidden" id="&lt;?='type'.$data-&gt;content_id?&gt;" value="&lt;?=$data-&gt;content_type?&gt;"/&gt; &lt;input type="hidden" id="&lt;?='user'.$data-&gt;content_id?&gt;" value="&lt;?=$_SESSION['user_type']?&gt;"/&gt; &lt;!-- dropable area --&gt; &lt;div class="" style="z-index: 1; position:fixed; right:124px; top:60px" id="div1" ondrop="drop(event);;" ondragover="allowDrop(event);"&gt; &lt;a href="#"&gt;&lt;img id="dropzon_image"src="&lt;?php echo IMAGE_PATH_HTTP?&gt;babbler_btn.jpg" alt="" border="0" style="cursor: pointer; cursor: hand; "/&gt;&lt;/a&gt;&lt;div id="overlay" style="display:none;z-index: 2; position:fixed; right:0px; top:32px; cursor: pointer;border-color: blueviolet;"&gt;&lt;img id="drop_image"src="&lt;?php echo IMAGE_PATH_HTTP?&gt;drop_image.jpg" alt="" border="1" style="cursor: pointer; cursor: hand; "/&gt; &lt;/div&gt;&lt;/div&gt; /*js */ function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); $("#div1").find("#overlay").slideDown(); setTimeout( function(){$("#overlay").hide();} , 4000); } function drop(ev) { var id = ev.dataTransfer.getData("Text");/*implimented solution*/ alert(id); ev.preventDefault(); var action='download'; var wall_id='62'; var stat = 'Album'; var cnt ='0'; var user_type='R'; var status = do_download(action,wall_id,stat,cnt,user_type); $("#overlay").hide(); // ev.target.appendChild(document.getElementById(data)); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload