拖拽代码
.xd{
.draggable:hover {
cursor: move;
cursor: -moz-move;
cursor: -webkit-move;
z-index: 1;
}
.draggable:hover::after {
position: absolute;
top: 50%;
left: 50%;
content: "drag me";
backdrop-filter: blur(20px);
font-family: 'Syne', sans-serif;
padding: 1rem;
border-radius: 50px;
color: white;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
// Add this code if you want to be able to move the elements inside the
containe only
$(function () {
$(".draggable").draggable({
containment: "parent"
});
});
// Add this code if you want to be able to move the elements outside the
containe
$(function () {
$(".draggable").draggable();
});
</script>
自定义鼠标
cursor: url(图片链接) 15 15, move !important;