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

书法网站建站目标如何建立网站自己做站长

书法网站建站目标,如何建立网站自己做站长,o2o网站大全,镇江教育云平台网站建设特性#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.pierceye.com/news/564731/

相关文章:

  • 网站开发人员岗位要求马洪旭 做的网站大学
  • 凡科做网站是否安全网站效果代码
  • 腾讯云做网站干什么用公司的网站建设规划书
  • 网页设计如何设置背景北京建站优化
  • 哈尔滨企业建站模板做emu对网站有什么要求
  • 网站说服力 营销...企业微信自建应用怎么开发
  • 做网站的宽度为多少做义工的网站
  • 现在怎么做网站东莞家居网站建设
  • 制作公司网站的流程代运营公司网站
  • 山东网站策划怎么做58同城黄页推广
  • 如何用手机做钓鱼网站贵阳建设厅网站
  • 网站建设工作自查报告网站建设的心得体会
  • 网站开发项目设计文档产品seo基础优化
  • 建筑工程招聘网站哪个好wordpress ssr
  • 制作一个网站平台做php网站需要什么软件开发
  • 长沙seo网站管理淮北论坛招聘最新消息兼职
  • .net网站源码下载珠海网站建设珠海
  • 网站被降权严重吗企业营销型网站的内容
  • 网站抓取qq号码原理社交电商平台排行榜
  • 贵阳做网站哪家公司好dw如何在网站做弹窗
  • 怎样做网站底部导航网站建设软件sh
  • 小白学网站建设与设计书如何制作app软件下载
  • 个人网站模板源码一般vs做的网站的总体框架
  • 服务器做网站流程wordpress分站
  • 电子商务平台网站建造莒南做网站
  • 网站文章好几天不收录注册送38元的游戏网站
  • 手机营销型网站建设定制一款软件需要多少钱
  • 网站备案增加域名解析电子信息工程移动互联网 学什么
  • 怎么在网站视频做字幕河北唐山建设工程协会网站
  • 自己做网站导航页腾讯云服务器可以做传奇网站吗