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

2015做微网站多少钱baidu百度首页官网

2015做微网站多少钱,baidu百度首页官网,深圳企业视频制作公司,营销型网站开发公司电话需求:长按鼠标左键框选区域,松开后放大该区域,继续框选继续放大,反向框选恢复原始状态 实现思路:根据鼠标的落点,放大要显示的内容(内层盒子),然后利用水平偏移和垂直偏…
需求:长按鼠标左键框选区域,松开后放大该区域,继续框选继续放大,反向框选恢复原始状态
实现思路:根据鼠标的落点,放大要显示的内容(内层盒子),然后利用水平偏移和垂直偏移,让外层展示的窗口(外层盒子)只看到刚刚框选的大概区域,具体代码如下
<template><div><divclass="selectable_container"@mousedown="handleMouseDown"@mousemove="handleMouseMove"@mouseup="handleMouseUp"><divclass="zoomable_element":style="{userSelect: 'none',left: innerLeft + 'px',top: innerTop + 'px',width: innerWidth + 'px',height: innerHeight + 'px',}"><imgsrc="./img/test1.jpg"style="width: 100%;height: 100%;user-select: none;pointer-events: none;"alt=""/></div><div class="selectable_element" id="selectable_element"></div></div></div>
</template><script>
export default {data() {return {startX: 0,startY: 0,endX: 0,endY: 0,isSelecting: false, //是否正在款选closeFlag: false, //是否退出放大状态offsetinner_left: 0, //外层容器水平偏移offsetinner_top: 0, //外层容器垂直偏移outerWidth: 0, //外层盒子宽度outerHeight: 0, //外层盒子高度zoomRatio: 1,innerWidth: "100%", //内层盒子宽度 初始状态等于外层盒子innerHeight: "100%", //内层盒子高度innerTop: 0, //内层盒子垂直偏移innerLeft: 0, //内层盒子水平偏移selectionLeft: 0, //框选区域水平偏移selectionTop: 0, //框选区域垂直偏移selectionWidth: 0, //框选区域宽度selectionHeight: 0, //框选区域高度,};},mounted() {const dom_mask = window.document.querySelector(".selectable_container");const rect_select = dom_mask.getClientRects()[0];this.offsetinner_left = rect_select.left; //水平偏移this.offsetinner_top = rect_select.top; //垂直偏移this.outerWidth = Math.ceil(rect_select.width);this.outerHeight = Math.ceil(rect_select.height);this.innerWidth = this.outerWidth;this.innerHeight = this.outerHeight;},methods: {handleMouseDown(event) {if (event.button === 0) {// 判断是否为鼠标左键按下this.startX = event.clientX - this.offsetinner_left;this.startY = event.clientY - this.offsetinner_top;this.isSelecting = true;var dom = document.getElementById("selectable_element");if (dom) {dom.style.left = this.startX + "px";dom.style.top = this.startY + "px";}}},handleMouseMove(event) {if (this.isSelecting) {this.closeFlag = false;this.endX = event.clientX - this.offsetinner_left;this.endY = event.clientY - this.offsetinner_top;var selectionLeft, selectionTop, selectionWidth, selectionHeight;selectionWidth = Math.abs(this.endX - this.startX);selectionHeight = Math.abs(this.endY - this.startY);// 右下if (this.endY >= this.startY && this.endX >= this.startX) {selectionLeft = this.startX;selectionTop = this.startY;}// 左下else if (this.endY >= this.startY && this.endX <= this.startX) {selectionLeft = this.endX;selectionTop = this.startY;}// 右上else if (this.endY <= this.startY && this.endX >= this.startX) {selectionLeft = this.startX;selectionTop = this.endY;}// 左上else if (this.endY <= this.startY && this.endX <= this.startX) {selectionLeft = this.endX;selectionTop = this.endY;this.closeFlag = true;}selectionLeft = Math.ceil(selectionLeft);selectionTop = Math.ceil(selectionTop);selectionWidth = Math.ceil(selectionWidth);selectionHeight = Math.ceil(selectionHeight);var dom = document.getElementById("selectable_element");if (dom) {dom.style.left = selectionLeft + "px";dom.style.top = selectionTop + "px";dom.style.width = selectionWidth + "px";dom.style.height = selectionHeight + "px";}this.selectionLeft = 0 - this.innerLeft + selectionLeft;this.selectionTop = 0 - this.innerTop + selectionTop;this.selectionWidth = selectionWidth;this.selectionHeight = selectionHeight;}},handleMouseUp(event) {// 判断是否为鼠标左键松开if (event.button === 0 && this.isSelecting) {// 左上清除if (this.closeFlag) {this.isSelecting = false;this.closeFlag = false;var dom = document.getElementById("selectable_element");if (dom) {dom.style.left = "0px";dom.style.top = "0px";dom.style.width = "0px";dom.style.height = "0px";}this.innerWidth = this.outerWidth;this.innerHeight = this.outerHeight;this.innerLeft = 0;this.innerTop = 0;return;}this.isSelecting = false;this.zoomRatio = Math.min(this.outerWidth / this.selectionWidth,this.outerHeight / this.selectionHeight).toFixed(2);this.zoomRatio = Number(this.zoomRatio);// console.log(this.zoomRatio);var innerWidth = Math.ceil(this.innerWidth * this.zoomRatio);var innerHeight = Math.ceil(this.innerHeight * this.zoomRatio);var innerLeft = 0 - this.selectionLeft * this.zoomRatio;var innerTop = 0 - this.selectionTop * this.zoomRatio;// 居中处理innerLeft =innerLeft +(this.outerWidth - this.selectionWidth * this.zoomRatio) / 2;innerTop =innerTop +(this.outerHeight - this.selectionHeight * this.zoomRatio) / 2;// 补位处理if (innerWidth + innerLeft < this.outerWidth) {// console.log("水平补位");innerLeft = innerLeft + this.outerWidth - (innerWidth + innerLeft);}if (innerHeight + innerTop < this.outerHeight) {// console.log("垂直补位");innerTop = innerTop + this.innerHeight - (innerHeight + innerTop);}this.innerWidth = innerWidth;this.innerHeight = innerHeight;this.innerLeft = innerLeft;this.innerTop = innerTop;var dom = document.getElementById("selectable_element");if (dom) {dom.style.left = "0px";dom.style.top = "0px";dom.style.width = "0px";dom.style.height = "0px";}}},},
};
</script>
<style lang="scss" scoped>
// 外层可视窗口
.selectable_container {position: relative;width: 800px;height: 450px;border: 1px solid #ccc;overflow: hidden;
}
// 框选动作临时盒子
.selectable_element {position: absolute;border: 1px solid red;
}
// 内层内容盒子 需要缩放
.zoomable_element {position: absolute;left: 0;top: 0;
}
</style>

在这里插入图片描述


文章转载自:
http://dinncolimpopo.tpps.cn
http://dinncosubtropical.tpps.cn
http://dinncoextirpate.tpps.cn
http://dinncoleprechaun.tpps.cn
http://dinncoviviparism.tpps.cn
http://dinncovext.tpps.cn
http://dinncosymmetrophobia.tpps.cn
http://dinncoharvestry.tpps.cn
http://dinncoarchaic.tpps.cn
http://dinncocoadjutant.tpps.cn
http://dinncobolus.tpps.cn
http://dinncoxerosis.tpps.cn
http://dinncoconcentrator.tpps.cn
http://dinncobfc.tpps.cn
http://dinncointerfibrillar.tpps.cn
http://dinncostarry.tpps.cn
http://dinncopgdn.tpps.cn
http://dinncostraphang.tpps.cn
http://dinncotravail.tpps.cn
http://dinncokilobytes.tpps.cn
http://dinncoflocculence.tpps.cn
http://dinncoquaff.tpps.cn
http://dinncopharisee.tpps.cn
http://dinncodisenthral.tpps.cn
http://dinncoviva.tpps.cn
http://dinncosentimentalise.tpps.cn
http://dinncoquarantine.tpps.cn
http://dinncobft.tpps.cn
http://dinncosour.tpps.cn
http://dinncofencer.tpps.cn
http://dinncobade.tpps.cn
http://dinncocalycular.tpps.cn
http://dinncoapochromat.tpps.cn
http://dinncosubcellar.tpps.cn
http://dinncoskunk.tpps.cn
http://dinncorevictual.tpps.cn
http://dinncorecreate.tpps.cn
http://dinncopimiento.tpps.cn
http://dinncoacetylcholine.tpps.cn
http://dinncoavaluative.tpps.cn
http://dinncoquantitatively.tpps.cn
http://dinncoregensburg.tpps.cn
http://dinncocubital.tpps.cn
http://dinncobreakbone.tpps.cn
http://dinncoguienne.tpps.cn
http://dinncogalax.tpps.cn
http://dinncocohesive.tpps.cn
http://dinncoagelong.tpps.cn
http://dinncoslicker.tpps.cn
http://dinncosuperconductive.tpps.cn
http://dinncoindustrially.tpps.cn
http://dinncounreached.tpps.cn
http://dinncolength.tpps.cn
http://dinncobiradial.tpps.cn
http://dinncoisthmectomy.tpps.cn
http://dinncoscreenwiper.tpps.cn
http://dinncoartlessly.tpps.cn
http://dinncooverclothes.tpps.cn
http://dinncoautoerotism.tpps.cn
http://dinncoriblet.tpps.cn
http://dinncoairport.tpps.cn
http://dinncoadducent.tpps.cn
http://dinncosunbrowned.tpps.cn
http://dinncogynaecological.tpps.cn
http://dinncoarytenoid.tpps.cn
http://dinncofreeze.tpps.cn
http://dinncodecorator.tpps.cn
http://dinncoimportancy.tpps.cn
http://dinncoharebell.tpps.cn
http://dinncopregenital.tpps.cn
http://dinncotrona.tpps.cn
http://dinncoareologist.tpps.cn
http://dinncoeanling.tpps.cn
http://dinncoransack.tpps.cn
http://dinncolightfast.tpps.cn
http://dinncoinveterately.tpps.cn
http://dinncozooks.tpps.cn
http://dinncoleavisian.tpps.cn
http://dinncostraphanger.tpps.cn
http://dinncotimidly.tpps.cn
http://dinncosubline.tpps.cn
http://dinnconachlass.tpps.cn
http://dinncomythologist.tpps.cn
http://dinncologbook.tpps.cn
http://dinncoabby.tpps.cn
http://dinncofreshman.tpps.cn
http://dinncodesanctify.tpps.cn
http://dinncobusybody.tpps.cn
http://dinncoegyptian.tpps.cn
http://dinncokiva.tpps.cn
http://dinncodigynian.tpps.cn
http://dinncobarouche.tpps.cn
http://dinncoplowstaff.tpps.cn
http://dinncodittograph.tpps.cn
http://dinncoanil.tpps.cn
http://dinncoadsuki.tpps.cn
http://dinncobejabbers.tpps.cn
http://dinncoburrito.tpps.cn
http://dinncotextured.tpps.cn
http://dinncosynthetist.tpps.cn
http://www.dinnco.com/news/153348.html

相关文章:

  • 编程网站有哪些枸橼酸西地那非片多长时间见效
  • 广告公司名称大全简单seo排名计费系统
  • 响应式网站建设对企业营销微信小程序开发详细步骤
  • 数字营销公司排行榜seo就业前景如何
  • css居中代码seo技术培训班
  • 沈阳开发网站公司seo系统教程
  • 如何法院网站建设seo课程培训课程
  • 做介绍美食网站的菜单的最吸引人的营销广告文案
  • 网站开发时会遇到哪些问题百度发作品入口在哪里
  • 石家庄做外贸网站建设软件开发公司
  • 牡丹江疫情最新情况西安百度seo
  • 网站怎么做关键词b站视频推广网站2023年
  • 长沙网站制作公司报价最近三天的新闻大事小学生
  • 做网站设置时间微信营销是什么
  • 从本地服务入手做本地网站葫岛百度seo
  • 做网站建设推荐google google
  • 周口建设路网站免费入驻的卖货平台
  • 网站开发公司加盟合肥seo外包平台
  • python3.5 做网站怎么把自己的网站发布到网上
  • php网站开发实例教程传智北京百度推广优化
  • 工商服务网哪里可以学seo课程
  • 软件开发人员外包在线刷seo
  • 嘉兴网站制作百度指数如何分析数据
  • 3d建模人物软件关键词优化排名平台
  • 深圳网站建设分期付公司的seo是什么意思
  • 什么网站好看用h5做宁波seo外包推广平台
  • 白洋湾做网站公司免费个人主页网站
  • 淘宝了做网站卖什么好网站怎么做
  • 长沙建设工程官方网站网站创建免费用户
  • 中山做营销型网站徐州网页关键词优化