Hey çocuklar ben bir sürükle ve bırak işlevi o does not fully work. Ne yapmak istiyorum sürükle ve bırak resim bir div içine ve o resim div açılır olması mümkün değildir. Şu anda 2 resimlerin bir listesi var, bu yüzden aşağıdaki işlev her resim için yankılandı var. Hem resim sürüklenebilir ve droppable, ama birincisi, çünkü jquery function seems to be unique to each picture Ben ne yanlış emin değilim içeri resim sürükledi alır bakılmaksızın, div görünen sadece bir tanesidir. Her biri herhangi bir öneriniz varsa ben çok takdir ediyorum.
while ($row = mysql_fetch_assoc($query)) {
$image=htmlentities($row['image']); //image name
$uniqid=uniqid(); //unique id for jquery functions
$dirname = "usercontent/$user/images/$image";
echo "<img id=\"$uniqid\" src=\"$dirname\" width=\"75\" height=\"75\"/>";
echo "<script>
$(function() {
$(\"#$uniqid\").draggable({ scroll: true, scrollSensitivity: 10, scrollSpeed: 10, revert: true, helper: 'clone', cursorAt: { cursor: 'move', top: 27, left: 27 } });
$(\"#droppable2, #droppable-background , #droppable2-innerer\").droppable({
greedy: true,
activeClass: 'ui-state-hover',
hoverClass: 'ui-state-active',
drop: function(event, ui) {
$(this).addClass('ui-state-highlight').find('> p').html('Dropped!');
$('#droppable-background').css(\"background-image\",\"url($dirname)\");
}
});
});
</script>";
}