Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>jQuery UI Draggable - Default functionality</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
- <style>
- #draggable { width: 150px; height: 150px; padding: 0.5em; border:1px solid black;}
- </style>
- <script>
- $(document).ready(function(){
- $("#draggable").draggable();
- });
- </script>
- </head>
- <body>
- <img id="draggable" src="small/Koala.jpg"/>
- <img id="draggable" src="small/Desert.jpg"/>
- <img id="draggable" src="small/Tulips.jpg"/>
- </body>
- </html>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>Wall Builder</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
- <style>
- .draggable { width: 85px; height: 85px; padding: 0.5em; border:1px solid black;}
- .droppable { width: 150px; height: 150px; padding: 0.5em; border:1px solid black;}
- </style>
- <script>
- $(document).ready(function() {
- $(".draggable").draggable({
- revert: "invalid"
- ,helper: 'clone'
- });
- $( ".droppable" ).droppable({
- accept: "draggable"
- });
- });
- </script>
- </head>
- <body>
- <img class="draggable" id="1" src="small/Koala.jpg"/>
- <img class="draggable" id="2" src="small/Desert.jpg"/>
- <img class="draggable" id="3" src="small/Tulips.jpg"/>
- <div class="droppable" id="d1"></div>
- <div class="droppable" id="d2"></div>
- <div class="droppable" id="d3"></div>
- <div class="droppable" id="d4"></div>
- <div class="droppable" id="d5"></div>
- </body>
- </html>
- <script>
- $(document).ready(function(){
- $(".draggable").draggable();
- });
- </script>
- </head>
- <body>
- <img class="draggable" src="small/Koala.jpg"/>
- <img class="draggable" src="small/Desert.jpg"/>
- <img class="draggable" src="small/Tulips.jpg"/>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement