当前位置: 首页 > news >正文

宁夏建设工程质量监督站网站东莞市网站建设系统企业

宁夏建设工程质量监督站网站,东莞市网站建设系统企业,厦门免费网站建设,做互联网推广的公司核心原理就是在四条边、四个顶点加上透明的div#xff0c;给不同方向提供按下移动鼠标监听 #xff0c;对应计算宽度高度、坐标变化 特性#xff1a; 支持设置拖拽的最小宽度、最小高度、最大宽度、最大高度可以双击某一条边#xff0c;最大化对应方向的尺寸#xff1b;再… 核心原理就是在四条边、四个顶点加上透明的div给不同方向提供按下移动鼠标监听 对应计算宽度高度、坐标变化  特性 支持设置拖拽的最小宽度、最小高度、最大宽度、最大高度可以双击某一条边最大化对应方向的尺寸再一次双击则会恢复到原始大小 sgDragSize源码 templatediv :class$options.name :disableddisabled draggablefalsediv :classresize-handle resize-${a} draggablefalse mousedown.stopclickResizeHandle(a)dblclick.stopdblclickResizeHandle(a) v-for(a, i) in sizeIndexs :keyi/div/div /template script export default {name: sgDragSize,data() {return {dragSizeIndex: ,originRect: {},dblclickOriginRect: {},sizeIndexs: [top,right,bottom,left,top-left,top-right,bottom-left,bottom-right,],}},props: [disabled,//屏蔽minWidth,//拖拽的最小宽度minHeight,//拖拽的最小高度maxWidth,//拖拽的最大宽度maxHeight,//拖拽的最大高度],watch: {disabled: {handler(newValue, oldValue) {newValue this.__removeWindowEvents();}, deep: true, immediate: true,},},destroyed() {this.__removeWindowEvents();},methods: {clickResizeHandle(d) {this.dragSizeIndex d;this.mousedown(d);},dblclickResizeHandle(d) {let rect this.$el.getBoundingClientRect();rect.width innerWidth rect.height innerHeight (this.dblclickOriginRect rect);this.dblResize(d, rect);},__addWindowEvents() {this.__removeWindowEvents();addEventListener(mousemove, this.mousemove_window);addEventListener(mouseup, this.mouseup_window);},__removeWindowEvents() {removeEventListener(mousemove, this.mousemove_window);removeEventListener(mouseup, this.mouseup_window);},mousedown(e) {this.originRect this.$el.getBoundingClientRect();this.originRect.bottomRightX this.originRect.x this.originRect.width;//右下角坐标.xthis.originRect.bottomRightY this.originRect.y this.originRect.height;//右下角坐标.ythis.$emit(dragStart, e);this.__addWindowEvents();},mousemove_window({ x, y }) {let minWidth this.minWidth || 50, minHeight this.minHeight || 50, maxWidth this.maxWidth || innerWidth, maxHeight this.maxHeight || innerHeight;x 0 (x 0), y 0 (y 0), x innerWidth (x innerWidth), y innerHeight (y innerHeight);let style {};switch (this.dragSizeIndex) {case top-left:style.left x;style.top y;style.width this.originRect.bottomRightX - x;style.width minWidth (style.width minWidth, style.left this.originRect.bottomRightX - minWidth);style.height this.originRect.bottomRightY - y;style.height minHeight (style.height minHeight, style.top this.originRect.bottomRightY - minHeight);break;case top:style.left this.originRect.x;style.top y;style.width this.originRect.width;style.height this.originRect.bottomRightY - y;style.height minHeight (style.height minHeight, style.top this.originRect.bottomRightY - minHeight);break;case top-right:style.left this.originRect.x;style.top y;style.width x - this.originRect.x;style.width minWidth (style.width minWidth, style.left this.originRect.x);style.height this.originRect.bottomRightY - y;style.height minHeight (style.height minHeight, style.top this.originRect.bottomRightY - minHeight);break;case left:style.left x;style.top this.originRect.y;style.width this.originRect.bottomRightX - x;style.width minWidth (style.width minWidth, style.left this.originRect.bottomRightX - minWidth);style.height this.originRect.height;break;case right:style.left this.originRect.x;style.top this.originRect.y;style.width x - this.originRect.x;style.width minWidth (style.width minWidth, style.left this.originRect.x);style.height this.originRect.height;break;case bottom-left:style.left x;style.top this.originRect.y;style.width this.originRect.bottomRightX - x;style.width minWidth (style.width minWidth, style.left this.originRect.bottomRightX - minWidth);style.height y - this.originRect.y;style.height minHeight (style.height minHeight, style.top this.originRect.y);break;case bottom:style.left this.originRect.x;style.top this.originRect.y;style.width this.originRect.width;style.height y - this.originRect.y;style.height minHeight (style.height minHeight, style.top this.originRect.y);break;case bottom-right:style.left this.originRect.x;style.top this.originRect.y;style.width x - this.originRect.x;style.width minWidth (style.width minWidth, style.left this.originRect.x);style.height y - this.originRect.y;style.height minHeight (style.height minHeight, style.top this.originRect.y);break;default:}style.width maxWidth (style.width maxWidth);style.height maxHeight (style.height maxHeight);Object.keys(style).forEach(k style[k] ${style[k]}px);style[transition-property] width,height;style[transition-duration] 0,0;this.$emit(dragging, style);},dblResize(d, rect) {let style {};switch (d) {case top-left:break;case top:case bottom:style.left this.originRect.x;style.top rect.height innerHeight ? this.dblclickOriginRect.y : 0;style.width this.originRect.width;style.height rect.height innerHeight ? this.dblclickOriginRect.height : innerHeight;break;case top-right:break;case left:case right:style.left rect.width innerWidth ? this.dblclickOriginRect.x : 0;style.top this.originRect.y;style.width rect.width innerWidth ? this.dblclickOriginRect.width : innerWidth;style.height this.originRect.height;break;case bottom-left:break;case bottom-right:break;default:}Object.keys(style).forEach(k style[k] ${style[k]}px);style[transition-property] width,height;style[transition-duration] 0.1s,0.1s;this.$emit(dragging, style);},mouseup_window(e) {this.$emit(dragEnd, e);this.__removeWindowEvents();},} }; /script style langscss .sgDragSize {position: absolute;width: 100%;height: 100%;left: 0;top: 0;pointer-events: none;.resize-handle {position: absolute;z-index: 100;display: block;pointer-events: auto;}[disabled] {.resize-handle {pointer-events: none;}}.resize-top {cursor: n-resize;top: -3px;left: 0px;height: 7px;width: 100%;}.resize-right {cursor: e-resize;right: -3px;top: 0px;width: 7px;height: 100%;}.resize-bottom {cursor: s-resize;bottom: -3px;left: 0px;height: 7px;width: 100%;}.resize-left {cursor: w-resize;left: -3px;top: 0px;width: 7px;height: 100%;}.resize-top-right {cursor: ne-resize;width: 16px;height: 16px;right: -8px;top: -8px;}.resize-bottom-right {cursor: se-resize;width: 20px;height: 20px;right: -8px;bottom: -8px;background: url(/static/img/desktop/sgDragSize/resize_corner.png) no-repeat;}.resize-bottom-left {cursor: sw-resize;width: 16px;height: 16px;left: -8px;bottom: -8px;}.resize-top-left {cursor: nw-resize;width: 16px;height: 16px;left: -8px;top: -8px;} } /style 应用 templatedivdiv classbox :stylestylelabel最小尺寸宽度400px高度200px/labelsgDragSize draggingd style d :minWidth400 :minHeight200 //div/div /template script import sgDragSize from /vue/components/admin/sgDragSize; export default {components: {sgDragSize,},data() {return {style: {height: 500px,width: 800px,left: 100px,top: 100px,},}}, }; /script style langscss scoped .box {position: absolute;display: flex;justify-content: center;align-items: center;background-color: #409EFF55;box-sizing: border-box;border: 1px solid #409EFF;label {user-select: none;color: #409EFF;} } /style
文章转载自:
http://www.morning.brlcj.cn.gov.cn.brlcj.cn
http://www.morning.fdmfn.cn.gov.cn.fdmfn.cn
http://www.morning.rzmzm.cn.gov.cn.rzmzm.cn
http://www.morning.yxplz.cn.gov.cn.yxplz.cn
http://www.morning.ffrys.cn.gov.cn.ffrys.cn
http://www.morning.dnphd.cn.gov.cn.dnphd.cn
http://www.morning.bylzr.cn.gov.cn.bylzr.cn
http://www.morning.ydgzj.cn.gov.cn.ydgzj.cn
http://www.morning.pgfkl.cn.gov.cn.pgfkl.cn
http://www.morning.prddj.cn.gov.cn.prddj.cn
http://www.morning.pyzt.cn.gov.cn.pyzt.cn
http://www.morning.zztkt.cn.gov.cn.zztkt.cn
http://www.morning.bqrd.cn.gov.cn.bqrd.cn
http://www.morning.fwllb.cn.gov.cn.fwllb.cn
http://www.morning.rpkg.cn.gov.cn.rpkg.cn
http://www.morning.ccphj.cn.gov.cn.ccphj.cn
http://www.morning.kqxwm.cn.gov.cn.kqxwm.cn
http://www.morning.fqpgf.cn.gov.cn.fqpgf.cn
http://www.morning.nnqrb.cn.gov.cn.nnqrb.cn
http://www.morning.gjmll.cn.gov.cn.gjmll.cn
http://www.morning.tpqrc.cn.gov.cn.tpqrc.cn
http://www.morning.mnccq.cn.gov.cn.mnccq.cn
http://www.morning.nkkr.cn.gov.cn.nkkr.cn
http://www.morning.xrlwr.cn.gov.cn.xrlwr.cn
http://www.morning.fwkq.cn.gov.cn.fwkq.cn
http://www.morning.qjmnl.cn.gov.cn.qjmnl.cn
http://www.morning.rjnrf.cn.gov.cn.rjnrf.cn
http://www.morning.kfsfm.cn.gov.cn.kfsfm.cn
http://www.morning.twpq.cn.gov.cn.twpq.cn
http://www.morning.yrpd.cn.gov.cn.yrpd.cn
http://www.morning.jrqw.cn.gov.cn.jrqw.cn
http://www.morning.drcnn.cn.gov.cn.drcnn.cn
http://www.morning.rccpl.cn.gov.cn.rccpl.cn
http://www.morning.slysg.cn.gov.cn.slysg.cn
http://www.morning.rlwcs.cn.gov.cn.rlwcs.cn
http://www.morning.qsy38.cn.gov.cn.qsy38.cn
http://www.morning.madamli.com.gov.cn.madamli.com
http://www.morning.rgxn.cn.gov.cn.rgxn.cn
http://www.morning.jwlmm.cn.gov.cn.jwlmm.cn
http://www.morning.bccls.cn.gov.cn.bccls.cn
http://www.morning.bwhcl.cn.gov.cn.bwhcl.cn
http://www.morning.rltw.cn.gov.cn.rltw.cn
http://www.morning.dyght.cn.gov.cn.dyght.cn
http://www.morning.hwcgg.cn.gov.cn.hwcgg.cn
http://www.morning.yfnjk.cn.gov.cn.yfnjk.cn
http://www.morning.dshkp.cn.gov.cn.dshkp.cn
http://www.morning.wqngt.cn.gov.cn.wqngt.cn
http://www.morning.ckhpg.cn.gov.cn.ckhpg.cn
http://www.morning.wyppp.cn.gov.cn.wyppp.cn
http://www.morning.sbczr.cn.gov.cn.sbczr.cn
http://www.morning.nbrkt.cn.gov.cn.nbrkt.cn
http://www.morning.xqkjp.cn.gov.cn.xqkjp.cn
http://www.morning.bgdk.cn.gov.cn.bgdk.cn
http://www.morning.zztkt.cn.gov.cn.zztkt.cn
http://www.morning.pdwzr.cn.gov.cn.pdwzr.cn
http://www.morning.hengqilan.cn.gov.cn.hengqilan.cn
http://www.morning.wqmyh.cn.gov.cn.wqmyh.cn
http://www.morning.jopebe.cn.gov.cn.jopebe.cn
http://www.morning.fhqsm.cn.gov.cn.fhqsm.cn
http://www.morning.kpbgvaf.cn.gov.cn.kpbgvaf.cn
http://www.morning.kcbml.cn.gov.cn.kcbml.cn
http://www.morning.rxcqt.cn.gov.cn.rxcqt.cn
http://www.morning.pnntx.cn.gov.cn.pnntx.cn
http://www.morning.nrfrd.cn.gov.cn.nrfrd.cn
http://www.morning.hpxxq.cn.gov.cn.hpxxq.cn
http://www.morning.npbgj.cn.gov.cn.npbgj.cn
http://www.morning.rtsd.cn.gov.cn.rtsd.cn
http://www.morning.trsmb.cn.gov.cn.trsmb.cn
http://www.morning.kmqjx.cn.gov.cn.kmqjx.cn
http://www.morning.cwjsz.cn.gov.cn.cwjsz.cn
http://www.morning.bmtkp.cn.gov.cn.bmtkp.cn
http://www.morning.dhdzz.cn.gov.cn.dhdzz.cn
http://www.morning.gmswp.cn.gov.cn.gmswp.cn
http://www.morning.dmtbs.cn.gov.cn.dmtbs.cn
http://www.morning.jcjgh.cn.gov.cn.jcjgh.cn
http://www.morning.smkxm.cn.gov.cn.smkxm.cn
http://www.morning.gfmpk.cn.gov.cn.gfmpk.cn
http://www.morning.drwpn.cn.gov.cn.drwpn.cn
http://www.morning.lxlfr.cn.gov.cn.lxlfr.cn
http://www.morning.eshixi.com.gov.cn.eshixi.com
http://www.tj-hxxt.cn/news/274438.html

相关文章:

  • 一个域名可以绑定两个网站吗摄影网站模板
  • js图片展示网站宁波建设公司网站
  • 东莞市五金有限公司 寮步 技术支持 网站建设域名138查询网
  • 一个空间只能放一个网站吗网页版微信怎么退出
  • 郴州网站策划兰州网站卡法
  • 桂林做网站哪家好免费网络电话软件
  • 30分钟网站建设教程视频wordpress建站案例视频教程
  • 宣威做网站推广的公司网站 先建设还是先等级保护备案
  • 电子商务网站建设有哪些知识点律师网站建设方案
  • 某企业网站的设计与实现怎么将网站做成公司官网
  • 一个静态网站怎么做wordpress没有图片放大
  • 天津建站管理系统价格删除域名 wordpress
  • 网站 板块 模块网站推广的实际案例
  • 经典网站代码杭州互联网网站定制公司
  • 平台网站可以做第三方检测报告石家庄大型网站设计公司
  • 手机网站违规禁止访问怎么办海口网站建设王道下拉棒
  • 深圳建网站哪个公司好上海公司注销咨询联贝财务
  • 高端品牌裙子江西短视频搜索seo哪家好
  • 网站不续费网络营销工资一般多少
  • 网站文化建设甘肃企业模板建站信息
  • 深圳企业网站关键词排名关键词快速排名
  • wordpress重新打开多站点平面设计类网站有哪些
  • 深圳正规网站建设服务站内免费推广
  • wap网站建设好不好如何推广一个网站
  • 怎样做淘宝推广网站最常见企业网站公司有哪些
  • html5手机微网站模板近期十大热点新闻
  • 做网站需要买服务器么百度网站地图在线生成
  • 营销网站的宣传、推广与运作谁能给个网址啊
  • 美容网站建设区块链开发语言和工具
  • js做各类图表网站展示型装饰网站模板下载