学无先后,达者为师

网站首页 编程语言 正文

jquery实现移动端悬浮拖拽框_jquery

作者:暖初     更新时间: 2022-04-27 编程语言

使用jquery 实现了一个基础的悬浮弹拖拽窗, 根据自己的需求去完善动效。 分享给大家供大家参考,具体如下:

演示效果

代码块

需要引入jquery , 引入本地或线上根据自己的情况修改





  
  
  
  移动端 拖拽按钮
  
  

  
  



  
   
     
   
 

CSS

基础css 根据自己需求修改

.main {
  position: relative;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: pink;
  padding: 1px;
  box-sizing: border-box;
}
.circle-box {
  position: absolute;
  top: 200px;
  bottom: 0;
/* 如果初始化设置right, 需先隐藏left, left级别大于right*/
  /* left: 0; */
  right: 1px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  z-index: 999;
}
.circle-box .circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  opacity: 0.5;

}

原文链接:https://blog.csdn.net/weixin_44406888/article/details/118159162

栏目分类
最近更新