<html> <head> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script src="../../Scripts/mootools-core-1.4.5-full-compat.js" type="text/javascript"></script> <script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script> <script type="text/javascript" > google.load("jquery", "1.6.3"); google.load("jqueryui", "1.8.16"); </script> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/> <style type="text/css"> .col{ float:left; padding: 5px 5px 5px 5px; margin: 5px 5px 5px 5px; } #col1{ width:200px; height:200px; border:1px solid black; } .drag{ width:50px; background:url(../../Content/themes/base/images/Design22.png); background-repeat:no-repeat; background-size:100% Auto; height:50px; } .drag1{ width:50px; background:url(../../Content/themes/base/images/Design23.png); background-repeat:no-repeat; background-size:100% Auto; height:50px; } .drag2{ width:50px; background:url(../../Content/themes/base/images/Design24.png); background-repeat:no-repeat; background-size:100% Auto; height:50px; } #droppable{ width:1000px; height :300px; border:1px solid black; } #save { display:inline; width:auto; height:auto; border:0px solid black; } </style> </head> <body> <div class = "col" id="col1"> <div id="drag1" class="drag" ></div> <div id="drag2" class="drag1"></div> <div id="drag3" class="drag2"></div> </div> <div class="col" id ="droppable"></div> <div id="save"> <input type="button" value="SAVE"/> </div> </body> </html> <script type="text/javascript"> debugger; $(document).ready(function () { var x = null; var y = null; //Make element draggable $(".drag").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit' }); $(".drag1").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit' }); $(".drag2").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit' }); $("#droppable").droppable({ drop: function (e, ui) { if ($(ui.draggable)[0].id !== "") { x = ui.helper.clone(); ui.helper.remove(); x.draggable({ helper: 'original', containment: '#droppable', tolerance: 'fit' }); x.resizable({ minHeight: 40, maxHeight: 1000, minWidth: 50, maxWidth: 1000 }); x.appendTo('#droppable'); } } }); $("#save").click(function () { alert("Saved"); }); }); </script>
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)