Circular Drag and Drop

Developer
Size
2,451 Kb
Views
6,072

How do I make an circular drag and drop?

Dragging and resizing of circle elements.. What is a circular drag and drop? How do you make a circular drag and drop? This script and codes were developed by Jeff Daze on 18 January 2023, Wednesday.

Circular Drag and Drop Previews

Circular Drag and Drop - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Circular Drag and Drop</title> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="container"> <button id="zoomPlus">ZOOM +</button><button id="zoomMinus">ZOOM -</button> <div class="drag" id="circle1"> <div class="circle">1</div> </div> <div class="drag" id="circle2"> <div class="circle">2</div> </div> <div class="drag" id="circle3"> <div class="circle">3</div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Circular Drag and Drop - Script Codes CSS Codes

body,html{ height:100%;
}
#container{ height:100%;
}
.drag{ width:100px; height:100px; border:1px solid transparent;
}
.circle{ border:1px solid #003; background-color: #37A047; -moz-border-radius:100%; -webkit-border-radius:100%; border-radius:100%; width:100%; height:100%; color:#FFF; text-align:center;
}
.selectedBorder{ border:1px solid #000; /* z-index:5 !important; */
}
/* ZOOOOOOM! */
/*
classes for browsers with zoom
*/
.zoomIn { zoom:200%; transform: scale(2);
}
.zoomOut { zoom:100%; transform: scale(1);
}
/*
and classes for browsers that don't support zoom
*/
.noZoom .zoomIn { -o-transform: scale(2); -moz-transform: scale(2); transform: scale(2);
}
.noZoom .zoomOut { -o-transform: scale(1); -moz-transform: scale(1); transform: scale(1);
}

Circular Drag and Drop - Script Codes JS Codes

$(function() { if($("#container").css("zoom") === undefined){ $("#container").addClass("noZoom"); }
$(".drag").draggable({ opacity: 0.75, stack: ".drag", start: function(e, ui){ selectBox($(this)); }
})
.resizable({ aspectRatio: true, handles: "all", autoHide: true
});
$(".drag").click(function(){ selectBox($(this));
});
$("#container").click(function(){ $(".drag").removeClass("selectedBorder");
}).children().click(function(){ return false;
});
function selectBox(element){ $(".drag").removeClass("selectedBorder"); $(element).toggleClass("selectedBorder"); //set highest z-index... var ziTop = 0; $(".drag").each(function(){ var ziTest = parseInt($(this).css("zIndex"), 10); if(ziTest > ziTop){ ziTop = ziTest; } }); $(element).css({ zIndex: ziTop+1 });
}
$("#zoomPlus").click(function(){ $("#container").addClass("zoomIn"); $("#container").removeClass("zoomOut");
});
$("#zoomMinus").click(function(){ $("#container").removeClass("zoomIn"); $("#container").addClass("zoomOut");
});
});
Circular Drag and Drop - Script Codes
Circular Drag and Drop - Script Codes
Home Page Home
Developer Jeff Daze
Username jeffdaze
Uploaded January 18, 2023
Rating 3
Size 2,451 Kb
Views 6,072
Do you need developer help for Circular Drag and Drop?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jeff Daze (jeffdaze) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!