SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery ui drag-and-drop Chrome go nut :(

    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.
    Code JavaScript:
    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.

  2. #2
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried with a simply snippet but it doesn't work yet ((
    http://mytube.blogial.net/chrome.html

  3. #3
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works in ie as well.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •