html5 - How to JQuery Drap and drop multiple/update msg on drop -
i have project - simple game, far can drag , drop need same draggable image - when dropped - update display in drop div...
<script type="text/javascript" src="game/js/jquery1.5.min.js"></script> <script type="text/javascript" src="game/js/jquery-ui1.8.min.js"></script> $( init ); function init() { $('#drag').draggable( { containment: '#content', cursor: 'move', snap: '#content', revert: true }) $('#drop').droppable( { drop: handledropevent } ) } function handledropevent( event, ui ) { var draggable = ui.draggable; //replace image.... var num = 5; num--; $(this).html('<img src="game/images/watermelon_-'+num+'.png">').data( ); //call php game->points(); points... }
Comments
Post a Comment