分享笔记:

拖拽元素效果

让你网站上的照片可以随意拖拽,纯属装...

文章目录

拖拽代码

.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;         

为笔记评分

平均评分 0 / 5. 摘星者: 0

留下第一个评论

更多结果...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

更多结果...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors