Hi,
this script works fine in FF opera (linux)
http://mytube.blogial.net/test.html
but go nut (just a lot ) in Chrome (Linux)
I didn’t test it on ie.
function buildPlaylist($){
var $draggable = $('.video-box > .dragme');
var $droppable = $('#aside');
$draggable.draggable({
revert: 'invalid',
helper: 'clone',
cursor: 'move'
});
$droppable.droppable({
accept: '.video-box > .dragme',
activeClass: 'custom-state-active',
hoverClass: 'custom-state-hover',
drop: function( event, ui ) {
resizeDraggedImage( ui.draggable );
}
});
function resizeDraggedImage( $item) {
var deleteIcon = '<a class="deleteVideoIcon" href="#" title="delete video from playlist"></a>';
$item.fadeOut(function() {
var $list = $( 'ul', $droppable ).length ?
$( 'ul', $droppable ) :
$( '<ul id="playlist">' ).appendTo( $droppable );
$item.append( deleteIcon ).appendTo( $list ).fadeIn(function() {
$item.wrap('<li></li>')
.find( "img" )
.animate({width: "60px", height: "45px" });
$('.deleteVideoIcon',$item).click(function() {
alert('Handler for .click() called.');
return false;
});
});
});
$item.hover(
function () {
$('a',this).css('display','block');
},
function () {
$('a',this).css('display','none');
});
var $clone = $item.clone();
var $closestDiv = $item.closest('div');
$clone.prependTo($closestDiv);
$item.removeClass('img dragme');
}
}
(function($){
buildPlaylist($);
})(jQuery);
Do you know why ?
Thanks in advance.