doszedłem już troszkę dalej, niestety nigdzie nie mogę znaleźć jak rozpoznać który element jest upuszczany, rozpoznaje na jaki mam upuszczany, ale niestety w droppem czyta tylko 1.
małymi kroczkami ku celu

Pozdrawiam i proszę o pomoc, KrzysiekKCN
<script> $(function() { function ShowElement(divname) { var selectedEffect; if (divname == "#blog") { //redirect window.location.href = "blog.subpage.com"; } if (divname == "#portfolio") { selectedEffect = "explode"; } if ((divname == "#onas") || (divname = "#kontakt")) { selectedEffect = "blind"; } var options = {}; $(divname).toggle( selectedEffect, options, 500 ); }; //$( "#icon" ).draggable(); $( ".icon" ).draggable(); $( "#start" ).droppable({ drop: function( event, ui ) { var okno = $(this).attr('id'); var przycisk= $('.icon').attr('id'); alert(okno); alert(przycisk); } }); }); </script>
Niżej kod całości do sprawdzenia:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <style> #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; } #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } </style> <script> $(function() { function ShowElement(divname) { var selectedEffect; if (divname == "#blog") { //redirect window.location.href = "blog.subpage.com"; } if (divname == "#portfolio") { selectedEffect = "explode"; } if ((divname == "#onas") || (divname = "#kontakt")) { selectedEffect = "blind"; } var options = {}; $(divname).toggle( selectedEffect, options, 500 ); }; //$( "#icon" ).draggable(); $( ".icon" ).draggable(); $( "#start" ).droppable({ drop: function( event, ui ) { var okno = $(this).attr('id'); var przycisk= $('.icon').attr('id'); alert(okno); alert(przycisk); } }); }); </script> <link rel="stylesheet" href="../demos.css"> </head> <body> <!-- links --> <div id="#onas" rel="#onas" class="icon" style="width: 150px; height: 50px; background: purple; text-align: center; font-weight: bold; color: white; z-index: 4;"> </div> <div id="#kontakt" rel="#kontakt" class="icon" style="width: 150px; height: 50px; background: purple; text-align: center; font-weight: bold; color: white; z-index: 4;"> </div> <div id="icon" rel="#portfolio" class="icon" style="width: 150px; height: 50px; background: purple; text-align: center; font-weight: bold; color: white; z-index: 4;"> </div> <div id="icon" rel="#blog" class="icon" style="width: 150px; height: 50px; background: purple; text-align: center; font-weight: bold; color: white; z-index: 4;"> </div> <hr> <div id="screen" style="background: black; margin: 20px; padding: 20px; width: 200px; height: 200px;"> <div id="start" style="background: magenta; height: 150px; width: 150px; position: absolute; top: 340px; left: 50px;"> </div> <div id="onas" style="background: red; height: 150px; width: 150px; position: absolute; top: 340px; left: 50px; display: none;"> </div> <div id="portfolio" style="background: green; height: 150px; width: 150px; position: absolute; top: 340px; left: 50px; display: none;"> </div> <div id="kontakt" style="background: yellow; height: 150px; width: 150px; position: absolute; top: 340px; left: 50px; display: none;"> </div> </div> </body> </html>