Ho implementato funzionalità drag and drop in jQuery e HTML5, il suo grande lavoro in cromo ma bloccato in Firefox che segue è il mio codice dove sto avvisando id dell'immagine caduto che appare come definito in Firefox seguente è il mio codice, per favore aiuto. jsfiddle: http://jsfiddle.net/rajutikale/2R6p8/drag and drop non funziona in Firefox
Vista:
<!-- dragable image -->
<a href="#?w=976" rel="popup1" id="<?=$album['album_id'].'-'.$data->content_id?>" class="poplight album_photos"><img id="<?=$album['album_id'].'-'.$data->content_id?>" draggable="true" ondragstart="drag(event)" ondragover="allowDrop(event)" alt="" src="<?=$imagePath?>"></a>
<input type="hidden" id="<?='wall'.$data->content_id?>" value="<?=$data->wall_id?>" />
<input type="hidden" id="<?='type'.$data->content_id?>" value="<?=$data->content_type?>" />
<input type="hidden" id="<?='user'.$data->content_id?>" value="<?=$_SESSION['user_type']?>" />
<!-- dropable area -->
<div class="" style="z-index: 1; position:fixed; right:124px; top:60px" id="div1" ondrop="drop(event);;" ondragover="allowDrop(event);"> <a href="#"><img id="dropzon_image"src="<?php echo IMAGE_PATH_HTTP?>babbler_btn.jpg" alt="" border="0" style="cursor: pointer; cursor: hand; "/></a>
<div id="overlay" style="display:none;z-index: 2; position:fixed; right:0px; top:32px; cursor: pointer;border-color: blueviolet;">
<img id="drop_image" src="<?php echo IMAGE_PATH_HTTP?>drop_image.jpg" alt="" border="1" style="cursor: pointer; cursor: hand; " />
</div>
</div>
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));
}
sembra funzionare bene qui. Quale versione di Firefox. Hai errori nella tua console? – putvande
ben sto usando 22.0, ho provato molto difficile da eseguire il debug, non ci vorrà mostrare alcun errore come tale in console come non sta sparando evento di trascinamento alla mia fine .... Si prega di suggerire che cosa devo fare? – Zorba
stessa domanda pubblicata più volte? http://stackoverflow.com/questions/18249081/my-solution-for-drag-drop-functionality-is-not-working-in-firefox – ViliusL