Help! JS drag and drop/window.open

Discussion in 'Scripts' started by jvangerven, Mar 25, 2012.

to remove all ads.
  1. jvangerven

    jvangerven New Member

    Messages:
    2
    Hello,

    I have this site where I can put clothes on a lady, a skirt=makeMeDraggable,
    pants=makeMeDraggable1,
    shirt=makeMeDraggable2,
    sweater=makeMeDraggable3,
    the lady=makeMeDroppable.

    Now, when I put the skirt on the lady, I want it to go to another window, where I can see info about the skirt.(skirt.html) And when I put the pants on the lady, I want it to go to another window where I can see info about the pants.(pants.html) Etc.

    I'm so far that I can drag and drop my clothes, but it always goes to the same window, the "skirt.html" , what do I need to add or change, that the right clothing will go to the right window?

    Many thanks in advance!


    This is the javascript I have..



    <script type="text/javascript">

    $( init );

    function init() {
    $('#makeMeDraggable').draggable();
    $('#makeMeDraggable1').draggable();
    $('#makeMeDraggable2').draggable();
    $('#makeMeDraggable3').draggable();
    $('#makeMeDroppable').droppable( {
    drop: handleDropEvent
    } );
    }

    function handleDropEvent( event, ui ) {
    var draggable = ui.draggable;
    window.open( 'skirt.html', '_self' );

    }

    </script>
     
  2. jvangerven

    jvangerven New Member

    Messages:
    2
    Problem solved !
     
  3. edwrdhcks

    edwrdhcks New Member

    Messages:
    1
    If you are still having problem please visit w3schools, and go to drag and drop tutorial...
     

Share This Page