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

唐山高端网站建设内网网站建设方案

唐山高端网站建设,内网网站建设方案,公司介绍ppt制作,做网站 深圳特性#xff1a; 支持缩放瓦片图#xff0c;定义瓦片图初始缩放比例#xff0c;以鼠标所在位置为中心缩放支持局部拖拽加载 sgTileImage源码 templatediv :class$options.namediv classsg-ctrllabel缩放百分比 支持缩放瓦片图定义瓦片图初始缩放比例以鼠标所在位置为中心缩放支持局部拖拽加载 sgTileImage源码  templatediv :class$options.namediv classsg-ctrllabel缩放百分比/labelel-input-number stylewidth: 150px; v-model.trimscaleValue :precision0 :step10 :min10 :max100:controls-positionleft changechangeScaleValue //divdiv classsg-tile-img refscrollContainerdiv refdragContainer :style{ width: ${tileSize * colCount}px }img v-for(a, i) in tiles :keyi :reftile${i} :loadeda.loaded :widthtileSize:heighttileSize draggablefalse/div/divsgDragMoveTile :datadragMoveTileData dragMovedragMove //div /template script import sgDragMoveTile from /vue/components/admin/sgDragMoveTile; export default {name: sgTileImage,components: {sgDragMoveTile},data() {return {dragMoveTileData: {},scaleValue: 100,orginTileSize: 0,tileSize: 0,colCount: 0,rowCount: 0,tiles: [],//瓦片图数组mousePoint_bk: null,}},props: [data,/* data格式:{orginTileSize:500,//瓦片图原始尺寸colCount: 20,//行数rowCount: 20,//列数scaleValue: 100,//缩放百分比tiles: [],//瓦片图数组} */],watch: {data: {handler(newValue, oldValue) {if (newValue Object.keys(newValue).length) {newValue.orginTileSize (this.orginTileSize newValue.orginTileSize);newValue.colCount (this.colCount newValue.colCount);newValue.rowCount (this.rowCount newValue.rowCount);newValue.scaleValue (this.scaleValue newValue.scaleValue);newValue.tiles (this.tiles newValue.tiles);this.$nextTick(() { this.loadScreenViewTiles(); });}},deep: true,//深度监听immediate: true,//立即执行},scaleValue: {handler(newValue, oldValue) {this.tileSize this.orginTileSize * newValue / 100;this.$nextTick(() { this.loadScreenViewTiles(); });},deep: true,//深度监听immediate: true,//立即执行},},destroyed() {removeEventListener(mousewheel, this.mousewheel);},mounted() {this.dragMoveTileData {scrollContainer: this.$refs.scrollContainer,dragContainer: this.$refs.dragContainer,}let rect_scrollContainer this.$refs.scrollContainer.getBoundingClientRect();this.mousePoint_bk {x: rect_scrollContainer.width / 2,y: rect_scrollContainer.height / 2,};setTimeout(() {this.loadScreenViewTiles();addEventListener(mousewheel, this.mousewheel, { passive: false });}, 1000);},methods: {// 校正放大缩小后瓦片图的坐标目的是为了让缩放看起来是以鼠标坐标为中心点centerPosition(e, {rect_dragContainer_orign,scrollLeft_orgin,scrollTop_orgin,mousePoint }) {let scrollContainer this.$refs.scrollContainer;let dragContainer this.$refs.dragContainer;let rect_dragContainer dragContainer.getBoundingClientRect();let scale rect_dragContainer.width / rect_dragContainer_orign.width;//缩放比例let mouse_left_dis_orgin scrollLeft_orgin mousePoint.x;//缩放前鼠标距离瓦片图最左侧的距离let mouse_top_dis_orgin scrollTop_orgin mousePoint.y;//缩放前鼠标距离瓦片图最顶部的距离let mouse_left_dis mouse_left_dis_orgin * scale;//缩放后鼠标距离瓦片图最左侧的距离let mouse_top_dis mouse_top_dis_orgin * scale;//缩放后鼠标距离瓦片图最顶部的距离let scrollLeft mouse_left_dis - mousePoint.x;let scrollTop mouse_top_dis - mousePoint.y;scrollContainer.scrollLeft scrollLeft;scrollContainer.scrollTop scrollTop;this.mousePoint_bk mousePoint;},mousewheel(e) {// 记录缩放前的数据let rect_dragContainer_orign this.$refs.dragContainer.getBoundingClientRect();let scrollContainer this.$refs.scrollContainer;let mousePoint { x: e.x, y: e.y };let scrollLeft_orgin scrollContainer.scrollLeft;let scrollTop_orgin scrollContainer.scrollTop;// 开始缩放e.deltaY 0 (this.scaleValue 10);e.deltaY 0 (this.scaleValue - 10);// 开始计算坐标this.$nextTick(() {this.centerPosition(e, {rect_dragContainer_orign,scrollLeft_orgin,scrollTop_orgin,mousePoint})});e.preventDefault e.preventDefault();//阻止默认的滚轮事件return false;},// 获取浏览器可视范围的瓦片图并加载图片loadScreenViewTiles(d) {let scrollContainer this.$refs.scrollContainer;if (scrollContainer) {let rect_scrollContainer scrollContainer.getBoundingClientRect();this.tiles.forEach((v, i) {let tile this.$refs[tile${i}];if (tile) {tile tile[0];let rectTile tile.getBoundingClientRect();if (rectTile.x rectTile.width rect_scrollContainer.x - rectTile.width rectTile.y rectTile.height rect_scrollContainer.y - rectTile.height rectTile.x rect_scrollContainer.x rect_scrollContainer.width rectTile.y rect_scrollContainer.y rect_scrollContainer.height) {tile.onload d { v.loaded true; };tile.src v.img;}}});}},dragMove(d) {this.loadScreenViewTiles();},changeScaleValue(d) {this.mousewheel(this.mousePoint_bk);},}, }; /script style langscss scoped .sgTileImage {.sg-ctrl {position: absolute;left: 10px;top: 10px;z-index: 1;box-sizing: border-box;padding: 10px 20px;background-color: white;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 4px;display: flex;align-items: center;justify-content: flex-end;label {margin-right: 10px;}}.sg-tile-img {position: absolute;left: 0;top: 0;overflow: auto;width: 100%;height: 100%;div {display: flex;flex-wrap: wrap;img {border: none;opacity: 0;transition: opacity .382s;[loaded] {opacity: 1;}}}}} /style 用例 templatedivsgTileImage :datatileImageData //div /template script import sgTileImage from /vue/components/admin/sgTileImage; export default {components: { sgTileImage },data() {return {tileImageData: {orginTileSize: 500,//瓦片图原始尺寸colCount: 20,//行数rowCount: 20,//列数tiles: [],//瓦片图数组}}},created() {this.tileImageData.tiles [...Array(this.tileImageData.colCount * this.tileImageData.rowCount)].map((v, i) ({loaded: false,img: http://shuzhiqiang.com/tiles/${i}.jpg,}));//瓦片图数组},}; /script 依赖组件【sgDragMoveTile】自定义组件拖拽瓦片图、地图、大图滚动条对应同步滚动_你挚爱的强哥的博客-CSDN博客【代码】【sgDragMoveTile】自定义组件拖拽瓦片图、地图、大图滚动条对应同步滚动。https://blog.csdn.net/qq_37860634/article/details/133292981
http://www.zqtcl.cn/news/264885/

相关文章:

  • 怎么做房产网站张家港高端网站制作
  • 做网站运营公司收费广东短视频seo搜索哪家好
  • 外贸网站 源码做的好详情页网站
  • 冀州网站制作邢台百姓网官网
  • 佛山做外贸网站方案自助网站推广系统
  • 安徽鸿顺鑫城建设集团网站小区物业管理网站开发报告
  • 有关网站建设文章常熟做网站多少钱
  • 网站流量报表江苏住房和城乡建设厅网站
  • 提供做网站公司有哪些个人建网站的费用
  • 网站后台添加表格wordpress垂直分页导航插件
  • 重庆网站建设有限公司六安市裕安区建设局网站
  • 北京产品网站建设如何做移动支付网站
  • 做同城购物网站赚钱吗设计企业网站流程
  • 网站要用什么软件做建设工程施工合同专属管辖
  • 模板网站建设制作佛山正规网站建设哪家好
  • 飞虎队网站建设网络公司起名大全
  • 如何发布自己的网站视频8首页制作代码
  • 网站开发实用案例教程普陀网站制作
  • 建一个网站需要哪些知识招远网站建设
  • 文章标题-栏目名称-网站名 dede环保网站设计建设论文
  • centos wordpress建站北京专门做网站的
  • wordpress网站的彻底清理百度网站联系方式
  • 网站建设签收单网页制作模板的作用
  • 已购买域名 如何做网站网络规划设计师通过率多少
  • 酒店网站建设需求分析wordpress iis
  • 烟台网站建设服务新钥匙网站建设
  • 帝国cms网站地图生成器行业网站建设哪家专业
  • 免费推广网站大全wordpress更改图片大小
  • 中航建设集团网站vps网站无法通过ip访问
  • 学生求职网站的需求分析怎么做江西手机版建站系统开发