//Drag and drop from minlista to program part
$(function() {
$("#minlista .thumb").draggable({
helper: 'clone',
opacity: 0.6,
cursor: 'move'
});
$("#exclist_open").droppable({
tolerance: 'touch',
accept: '#minlista .thumb',
drop: function(ev, ui){
var id = ui.draggable.find("img").attr("id");
var pp_id = $(this).find("div").attr("id");
var add_exc = '&exc_id=' + id + '&program_part_id='+ pp_id +'&action=addExcToPart';
//window.location.reload(true);
$.post("updateDB.php", add_exc);
$(this).append($(ui.draggable).clone());
}
});
});
2011-05-16-18-44-40.png
ASKER
ASKER
ASKER
ASKER
//Draggable area
<div class="thumb">
<img src="<?=$APP->illustration_url?><?=$lrow['filename'].'-tb.'.$lrow['file_ext']?>" alt="<?=$lrow['exc_name']?>" title="<?=$lrow['exc_name']?>" id="<?=$lrow['exc_id']?>" class="thumbImage"/>
</div>
//Jquery
$(function() {
$("#minlista .thumbImage").draggable({
helper: 'clone',
opacity: 0.6,
cursor: 'move'
});
$("#exclist_open").droppable({
tolerance: 'touch',
accept: '#minlista .thumbImage',
drop: function(ev, ui){
var exc_id = ui.draggable.attr("id");
var pp_id = $(this).find("div").attr("id");
var add_exc = '&exc_id=' + exc_id + '&program_part_id='+ pp_id +'&action=addExcToPart';
//window.location.reload(true);
$.post("updateDB.php", add_exc);
var largeSlide = $(ui.draggable).clone();
$(largeSlide).attr("src", $(largeSlide).attr("src").replace('-tb', '-m' ));
$(this).append(largeSlide);
}
});
});
ASKER
jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.
TRUSTED BY
before this do
$(this).append($(ui.dragga
do something like
var largeSlide = $(ui.draggable).clone(); // clone the small slide into the largeSlide object.
$(largeSlide).attr("src", $(largeSlide).attr("src") + "large"); // change the source attribute on the cloned object.
$(this).append(largeSlide)