Having just started with HTML and jQuery, I am looking to create three draggable divs stacked one below the other - div1, div2, and so on. I want to drag div1 into the position of div3, changing the order to div3, div1, div2. How can this be achieved?
Please assist me...
<html>
<head>
<title>My First Template </title>
<style type="text/css">
html {
background: url(Software.png) no-repeat center center fixed;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
}
</style>
<link rel="stylesheet" href="stylesheets/jquery.sidr.dark.css">
<script src="jquery.js" ></script>
<script src="jquery.sidr.min.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="SignUp.css">
<script src="jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
$("#div1").draggable();
$("#div2").draggable();
$("#div3").draggable();
$("#div4").draggable();
});
</script>
</head>
<body>
<div id="div1" style="position: relative; left: 850px; top: 100px; width: 500px; height: 100px; background-color: white">div1</div>
<div id="div2" style="position: relative; left: 850px; top: 150px; width: 500px; height: 100px; background-color: blue">div2</div>
<div id="div3" style="position: relative; left: 850px; top: 200px; width: 500px; height: 100px; background-color: green">div3</div>
<div id="div4" style="position: relative; left: 850px; top: 250px; width: 500px; height: 100px; background-color: red">div4</div>
</body>
</html>