웹 프론트엔드 JS 튜토리얼 이미지 회전, 마우스 휠 줌, 미러링, 이미지 전환 js code_javascript 기술

이미지 회전, 마우스 휠 줌, 미러링, 이미지 전환 js code_javascript 기술

May 16, 2016 pm 03:19 PM
js 그림 회전 거울

本文实例为大家展示了图片旋转、鼠标滚轮缩放、镜像、切换图片多重效果,提供了详细的代码,分享给大家供大家参考,具体内容如下

具体代码:

<!DOCTYPE html>
<html lang="zh-cn">
 <head>
  <title>图片旋转,鼠标滚轮缩放,镜像,切换图片</title>
  <meta charset="utf-8" />
  <!--<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>-->
  <script type="text/javascript" src="js/abc.js"></script>
 </head>

 <body>

  <h1 style="text-align: center;color: blue;">效果预览</h1>
  <script>
   //容器对象
   var ImageTrans = function(container, options) {
    this._initialize(container, options);
    this._initMode();
    if (this._support) {
     this._initContainer();
     this._init();
    } else { //模式不支持
     this.onError("not support");
    }
   };
   ImageTrans.prototype = {
    //初始化程序
    _initialize: function(container, options) {
     var container = this._container = $$(container);
  this._clientWidth = container.clientWidth; //变换区域宽度
  this._clientHeight = container.clientHeight; //变换区域高度
  this._img = new Image(); //图片对象
  this._style = {}; //备份样式
  this._x = this._y = 1; //水平/垂直变换参数
  this._radian = 0; //旋转变换参数
  this._support = false; //是否支持变换
  this._init = this._load = this._show = this._dispose = $$.emptyFunction;
     var opt = this._setOptions(options);
     this._zoom = opt.zoom;
     this.onPreLoad = opt.onPreLoad;
     this.onLoad = opt.onLoad;
     this.onError = opt.onError;
     this._LOAD = $$F.bind(function() {
  this.onLoad();
  this._load();
  this.reset();
  this._img.style.visibility = "visible";
  }, this);
  $$CE.fireEvent(this, "init");
    },
    //设置默认属性
    _setOptions: function(options) {
     this.options = { //默认值
      mode: "css3|filter|canvas",
      zoom: .1, //缩放比率
      onPreLoad: function() {}, //图片加载前执行
      onLoad: function() {}, //图片加载后执行
      onError: function(err) {} //出错时执行
     };
     return $$.extend(this.options, options || {});
 },
 //模式设置
 _initMode: function() {
  var modes = ImageTrans.modes;
  this._support = $$A.some(this.options.mode.toLowerCase().split("|"), function(mode) {
  mode = modes[mode];
  if (mode && mode.support) {
  mode.init && (this._init = mode.init); //初始化执行程序
  mode.load && (this._load = mode.load); //加载图片执行程序
  mode.show && (this._show = mode.show); //变换显示程序
  mode.dispose && (this._dispose = mode.dispose); //销毁程序
  //扩展变换方法
  $$A.forEach(ImageTrans.transforms, function(transform, name) {
  this[name] = function() {
   transform.apply(this, [].slice.call(arguments));
   this._show();
  }
  }, this);
  return true;
  }
  }, this);
 },
 //初始化容器对象
 _initContainer: function() {
  var container = this._container,
  style = container.style,
  position = $$D.getStyle(container, "position");
  this._style = {
  "position": style.position,
  "overflow": style.overflow
  }; //备份样式
  if (position != "relative" && position != "absolute") {
  style.position = "relative";
  }
  style.overflow = "hidden";
  $$CE.fireEvent(this, "initContainer");
 },
 //加载图片
 load: function(src) {
  if (this._support) {
  var img = this._img,
  oThis = this;
  img.onload || (img.onload = this._LOAD);
  img.onerror || (img.onerror = function() {
  oThis.onError("err image");
  });
  img.style.visibility = "hidden";
  this.onPreLoad();
  img.src = src;
  }
 },
 //重置
 reset: function() {
  if (this._support) {
  this._x = this._y = 1;
  this._radian = 0;
  this._show();
  }
 },
 //销毁程序
 dispose: function() {
  if (this._support) {
  this._dispose();
  $$CE.fireEvent(this, "dispose");
  $$D.setStyle(this._container, this._style); //恢复样式
  this._container = this._img = this._img.onload = this._img.onerror = this._LOAD = null;
  }
 }
 };
 //变换模式
 ImageTrans.modes = function() {
 var css3Transform; //ccs3变换样式
 //初始化图片对象函数
 function initImg(img, container) {
  $$D.setStyle(img, {
  position: "absolute",
  border: 0,
  padding: 0,
  margin: 0,
  width: "auto",
  height: "auto", //重置样式
  visibility: "hidden" //加载前隐藏
  });
  container.appendChild(img);
 }
 //获取变换参数函数
 function getMatrix(radian, x, y) {
  var Cos = Math.cos(radian),
  Sin = Math.sin(radian);
  return {
  M11: Cos * x,
  M12: -Sin * y,
  M21: Sin * x,
  M22: Cos * y
  };
 }
 return {
  css3: { //css3设置
  support: function() {
  var style = document.createElement("div").style;
  return $$A.some(
  ["transform", "MozTransform", "webkitTransform", "OTransform"],
  function(css) {
   if (css in style) {
   css3Transform = css;
   return true;
   }
  });
  }(),
  init: function() {
  initImg(this._img, this._container);
  },
  load: function() {
  var img = this._img;
  $$D.setStyle(img, { //居中
  top: (this._clientHeight - img.height) / 2 + "px",
  left: (this._clientWidth - img.width) / 2 + "px",
  visibility: "visible"
  });
  },
  show: function() {
  var matrix = getMatrix(this._radian, this._y, this._x);
  //设置变形样式
  this._img.style[css3Transform] = "matrix(" + matrix.M11.toFixed(16) + "," + matrix.M21.toFixed(16) + "," + matrix.M12.toFixed(16) + "," + matrix.M22.toFixed(16) + ", 0, 0)";
  },
  dispose: function() {
  this._container.removeChild(this._img);
  }
  },
  filter: { //滤镜设置
  support: function() {
  return "filters" in document.createElement("div");
  }(),
  init: function() {
  initImg(this._img, this._container);
  //设置滤镜
  this._img.style.filter = "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand')";
  },
  load: function() {
  this._img.onload = null; //防止ie重复加载gif的bug
  this._img.style.visibility = "visible";
  },
  show: function() {
  var img = this._img;
  //设置滤镜
  $$.extend(
  img.filters.item("DXImageTransform.Microsoft.Matrix"),
  getMatrix(this._radian, this._y, this._x)
  );
  //保持居中
  img.style.top = (this._clientHeight - img.offsetHeight) / 2 + "px";
  img.style.left = (this._clientWidth - img.offsetWidth) / 2 + "px";
  },
  dispose: function() {
  this._container.removeChild(this._img);
  }
  },
  canvas: { //canvas设置
  support: function() {
  return "getContext" in document.createElement('canvas');
  }(),
  init: function() {
  var canvas = this._canvas = document.createElement('canvas'),
  context = this._context = canvas.getContext('2d');
  //样式设置
  $$D.setStyle(canvas, {
  position: "absolute",
  left: 0,
  top: 0
  });
  canvas.width = this._clientWidth;
  canvas.height = this._clientHeight;
  this._container.appendChild(canvas);
  },
  show: function() {
  var img = this._img,
  context = this._context,
  clientWidth = this._clientWidth,
  clientHeight = this._clientHeight;
  //canvas变换
  context.save();
  context.clearRect(0, 0, clientWidth, clientHeight); //清空内容
  context.translate(clientWidth / 2, clientHeight / 2); //中心坐标
  context.rotate(this._radian); //旋转
  context.scale(this._y, this._x); //缩放
  context.drawImage(img, -img.width / 2, -img.height / 2); //居中画图
  context.restore();
  },
  dispose: function() {
  this._container.removeChild(this._canvas);
  this._canvas = this._context = null;
  }
  }
 };
 }();
 //变换方法
 ImageTrans.transforms = {
 //垂直翻转
 vertical: function() {
  this._radian = Math.PI - this._radian;
  this._y *= -1;
 },
 //水平翻转
 horizontal: function() {
  this._radian = Math.PI - this._radian;
  this._x *= -1;
 },
 //根据弧度旋转
 rotate: function(radian) {
  this._radian = radian;
 },
 //向左转90度
 left: function() {
  this._radian -= Math.PI / 2;
 },
 //向右转90度
 right: function() {
  this._radian += Math.PI / 2;
 },
 //根据角度旋转
 rotatebydegress: function(degress) {
  this._radian = degress * Math.PI / 180;
 },
 //缩放
 scale: function() {
  function getZoom(scale, zoom) {
  return scale > 0 && scale > -zoom &#63; zoom :
  scale < 0 && scale < zoom &#63; -zoom : 0;
  }
  return function(zoom) {
  if (zoom) {
  var hZoom = getZoom(this._y, zoom),
  vZoom = getZoom(this._x, zoom);
  if (hZoom && vZoom) {
  this._y += hZoom;
  this._x += vZoom;
  }
  }
  }
 }(),
 //放大
 zoomin: function() {
  this.scale(Math.abs(this._zoom));
 },
 //缩小
 zoomout: function() {
  this.scale(-Math.abs(this._zoom));
 }
 };
 //拖动旋转
 ImageTrans.prototype._initialize = (function() {
 var init = ImageTrans.prototype._initialize,
  methods = {
  "init": function() {
  this._mrX = this._mrY = this._mrRadian = 0;
  this._mrSTART = $$F.bind(start, this);
  this._mrMOVE = $$F.bind(move, this);
  this._mrSTOP = $$F.bind(stop, this);
  },
  "initContainer": function() {
  $$E.addEvent(this._container, "mousedown", this._mrSTART);
  },
  "dispose": function() {
  $$E.removeEvent(this._container, "mousedown", this._mrSTART);
  this._mrSTOP();
  this._mrSTART = this._mrMOVE = this._mrSTOP = null;
  }
  };
 //开始函数
 function start(e) {
  var rect = $$D.clientRect(this._container);
  this._mrX = rect.left + this._clientWidth / 2;
  this._mrY = rect.top + this._clientHeight / 2;
  this._mrRadian = Math.atan2(e.clientY - this._mrY, e.clientX - this._mrX) - this._radian;
  $$E.addEvent(document, "mousemove", this._mrMOVE);
  $$E.addEvent(document, "mouseup", this._mrSTOP);
  if ($$B.ie) {
  var container = this._container;
  $$E.addEvent(container, "losecapture", this._mrSTOP);
  container.setCapture();
  } else {
  $$E.addEvent(window, "blur", this._mrSTOP);
  e.preventDefault();
  }
 };
 //拖动函数
 function move(e) {
  this.rotate(Math.atan2(e.clientY - this._mrY, e.clientX - this._mrX) - this._mrRadian);
  window.getSelection &#63; window.getSelection().removeAllRanges() : document.selection.empty();
 };
 //停止函数
 function stop() {
  $$E.removeEvent(document, "mousemove", this._mrMOVE);
  $$E.removeEvent(document, "mouseup", this._mrSTOP);
  if ($$B.ie) {
  var container = this._container;
  $$E.removeEvent(container, "losecapture", this._mrSTOP);
  container.releaseCapture();
  } else {
  $$E.removeEvent(window, "blur", this._mrSTOP);
  };
 };
 return function() {
  var options = arguments[1];
  if (!options || options.mouseRotate !== false) {
  //扩展钩子
  $$A.forEach(methods, function(method, name) {
  $$CE.addEvent(this, name, method);
  }, this);
  }
  init.apply(this, arguments);
 }
 })();
 //滚轮缩放
 ImageTrans.prototype._initialize = (function() {
 var init = ImageTrans.prototype._initialize,
  mousewheel = $$B.firefox &#63; "DOMMouseScroll" : "mousewheel",
  methods = {
  "init": function() {
  this._mzZoom = $$F.bind(zoom, this);
  },
  "initContainer": function() {
  $$E.addEvent(this._container, mousewheel, this._mzZoom);
  },
  "dispose": function() {
  $$E.removeEvent(this._container, mousewheel, this._mzZoom);
  this._mzZoom = null;
  }
  };
 //缩放函数
 function zoom(e) {
  this.scale((
  e.wheelDelta &#63; e.wheelDelta / (-120) : (e.detail || 0) / 3
  ) * Math.abs(this._zoom));
  e.preventDefault();
 };
 return function() {
  var options = arguments[1];
  if (!options || options.mouseZoom !== false) {
  //扩展钩子
  $$A.forEach(methods, function(method, name) {
  $$CE.addEvent(this, name, method);
      }, this);
     }
     init.apply(this, arguments);
    }
   })();
  </script>
  <style>
   #idContainer {
    border: 1px solid red;
    width: 1000px;
    height: 500px;
    background: black center no-repeat;
    margin: 0 auto;
   }

   input {
    margin: 10px;
    padding: 10px;
    border: 1px solid red;
    background: yellow;
    color: green;
    font-size: 16px;
   }

   #idSrc {
    width: auto;
   }
  </style>

  <div id="idContainer"></div>
  <input id="idLeft" value="向左旋转" type="button" />
  <input id="idRight" value="向右旋转" type="button" />
  <input id="idVertical" value="垂直翻转" type="button" />
  <input id="idHorizontal" value="水平翻转" type="button" />
  <input id="idReset" value="重置" type="button" />
  <input id="idCanvas" value="使用Canvas" type="button" />
  <input id="idSrc" value="img/07.jpg" type="text" />
  <input id="idLoad" value="换图" type="button" />
  <script>
   (function() {
    var container = $$("idContainer"),
  src = "img/7.jpg",
  options = {
  onPreLoad: function() {
  container.style.backgroundImage = "url('http://images.cnblogs.com/cnblogs_com/cloudgamer/169629/o_loading.gif')";
  },
  onLoad: function() {
  container.style.backgroundImage = "";
  },
  onError: function(err) {
  container.style.backgroundImage = "";
  alert(err);
  }
  },
  it = new ImageTrans(container, options);
 it.load(src);
 //垂直翻转
 $$("idVertical").onclick = function() {
      it.vertical();
     }
     //水平翻转
    $$("idHorizontal").onclick = function() {
  it.horizontal();
  }
  //左旋转
 $$("idLeft").onclick = function() {
      it.left();
     }
     //右旋转
    $$("idRight").onclick = function() {
  it.right();
  }
  //重置
 $$("idReset").onclick = function() {
      it.reset();
     }
     //换图
    $$("idLoad").onclick = function() {
  it.load($$("idSrc").value);
  }
  //Canvas
 $$("idCanvas").onclick = function() {
     if (this.value == "默认模式") {
      this.value = "使用Canvas";
      delete options.mode;
     } else {
      this.value = "默认模式";
      options.mode = "canvas";
     }
     it.dispose();
     it = new ImageTrans(container, options);
     it.load(src);
    }
   })()
  </script>

 </body>

</html>
로그인 후 복사

abc.js

eval(function(p, a, c, k, e, r) {
 e = function(c) {
  return (c < 62 &#63; '' : e(parseInt(c / 62))) + ((c = c % 62) > 35 &#63; String.fromCharCode(c + 29) : c.toString(36))
 };
 if ('0'.replace(0, e) == 0) {
  while (c--) r[e(c)] = k[c];
  k = [function(e) {
   return r[e] || e
  }];
  e = function() {
   return '([3-59cf-hj-mo-rt-yCG-NP-RT-Z]|[12]\\w)'
  };
  c = 1
 };
 while (c--)
  if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
 return p
}('4 $$,$$B,$$A,$$F,$$D,$$E,$$CE,$$S;(3(1K){4 O,B,A,F,D,E,CE,S;O=3(id){5"2f"==1L id&#63;G
로그인 후 복사

以上就是js代码实现图片旋转、鼠标滚轮缩放、镜像、切换图片等效果的代码,希望对大家学习javascript程序设计有所帮助。

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

ao3 미러 공식 홈페이지 입구 ao3 미러 공식 홈페이지 입구 Feb 24, 2024 am 11:34 AM

ao3 미러는 팬픽션 제작을 위한 플랫폼이지만 대부분의 친구들은 ao3 미러 공식 웹사이트가 어디에 있는지 모릅니다. https://ao3.cubeart.club/ 링크를 클릭하여 ao3 미러 웹사이트에 들어갑니다. 편집자는 ao3 미러 2024의 최신 공식 웹사이트 입구를 사용자에게 소개합니다. 관심 있는 사용자는 와서 살펴보세요! ao3 미러 공식 홈페이지 포털: https://ao3.cubeart.club/ 1. 다운로드 주소 1. AO3: 다운로드하려면 클릭하세요》》 2. AO3 최신 버전: 다운로드하려면 클릭하세요》》 2. 웹사이트 방법 입력 1. 복사 웹사이트를 브라우저에서 확인하고 페이지 오른쪽 상단의 [로그인]을 클릭하여 들어갑니다.

CentOS7 다양한 버전 이미지 다운로드 주소 및 버전 설명(Everything 버전 포함) CentOS7 다양한 버전 이미지 다운로드 주소 및 버전 설명(Everything 버전 포함) Feb 29, 2024 am 09:20 AM

CentOS-7.0-1406을 로드할 때 옵션 버전이 많이 있습니다. 일반 사용자의 경우 어떤 버전을 선택해야 할지 모릅니다. 다음은 간략한 소개입니다. (1) CentOS-xxxx-LiveCD.ios 및 CentOS-xxxx- What bin-DVD.iso의 차이점은 무엇입니까? 전자는 700M만 있고 후자는 3.8G를 갖고 있다. 차이점은 크기뿐 아니라 더 본질적인 차이점은 CentOS-xxxx-LiveCD.ios는 메모리에 로드 및 실행만 가능하고, 설치할 수 없다는 점입니다. CentOS-xxx-bin-DVD1.iso만 하드 디스크에 설치할 수 있습니다. (2) CentOS-xxx-bin-DVD1.iso, Ce

JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 Nov 21, 2023 am 10:00 AM

JS 및 Baidu Map을 사용하여 지도 팬 기능을 구현하는 방법 Baidu Map은 지리 정보, 위치 지정 및 기타 기능을 표시하기 위해 웹 개발에 자주 사용되는 널리 사용되는 지도 서비스 플랫폼입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도 이동 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 1. 준비 바이두 맵 API를 사용하기 전에 먼저 바이두 맵 오픈 플랫폼(http://lbsyun.baidu.com/)에서 개발자 계정을 신청하고 애플리케이션을 만들어야 합니다. 생성 완료

권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 Apr 03, 2024 am 11:55 AM

얼굴 검출 및 인식 기술은 이미 상대적으로 성숙하고 널리 사용되는 기술입니다. 현재 가장 널리 사용되는 인터넷 응용 언어는 JS입니다. 웹 프런트엔드에서 얼굴 감지 및 인식을 구현하는 것은 백엔드 얼굴 인식에 비해 장점과 단점이 있습니다. 장점에는 네트워크 상호 작용 및 실시간 인식이 줄어 사용자 대기 시간이 크게 단축되고 사용자 경험이 향상된다는 단점이 있습니다. 모델 크기에 따라 제한되고 정확도도 제한됩니다. js를 사용하여 웹에서 얼굴 인식을 구현하는 방법은 무엇입니까? 웹에서 얼굴 인식을 구현하려면 JavaScript, HTML, CSS, WebRTC 등 관련 프로그래밍 언어 및 기술에 익숙해야 합니다. 동시에 관련 컴퓨터 비전 및 인공지능 기술도 마스터해야 합니다. 웹 측면의 디자인으로 인해 주목할 가치가 있습니다.

PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 Dec 17, 2023 am 08:08 AM

PHP와 JS를 사용하여 주식 캔들 차트를 만드는 방법 주식 캔들 차트는 주식 시장에서 흔히 사용되는 기술 분석 그래픽으로 시가, 종가, 최고가 등의 데이터를 그려서 투자자가 주식을 보다 직관적으로 이해할 수 있도록 도와줍니다. 주식의 최저 가격. 이 기사에서는 특정 코드 예제와 함께 PHP 및 JS를 사용하여 주식 캔들 차트를 만드는 방법을 설명합니다. 1. 준비 시작하기 전에 다음 환경을 준비해야 합니다. 1. PHP를 실행하는 서버 2. HTML5 및 Canvas를 지원하는 브라우저 3

주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. 주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. Dec 17, 2023 pm 06:55 PM

주식 분석을 위한 필수 도구: PHP 및 JS에서 캔들 차트를 그리는 단계를 배우십시오. 인터넷과 기술의 급속한 발전으로 주식 거래는 많은 투자자에게 중요한 방법 중 하나가 되었습니다. 주식분석은 투자자의 의사결정에 있어 중요한 부분이며 캔들차트는 기술적 분석에 널리 사용됩니다. PHP와 JS를 사용하여 캔들 차트를 그리는 방법을 배우면 투자자가 더 나은 결정을 내리는 데 도움이 되는 보다 직관적인 정보를 얻을 수 있습니다. 캔들스틱 차트는 주가를 캔들스틱 형태로 표시하는 기술 차트입니다. 주가를 보여주네요

화웨이, 인스퍼(Inspur) 및 기타 부서가 공동으로 만든 오픈소스 컨테이너 미러링 센터인 AtomHub는 공개 테스트를 위해 공식적으로 공개되었으며 국내 서비스를 안정적으로 다운로드할 수 있다고 발표했습니다. 화웨이, 인스퍼(Inspur) 및 기타 부서가 공동으로 만든 오픈소스 컨테이너 미러링 센터인 AtomHub는 공개 테스트를 위해 공식적으로 공개되었으며 국내 서비스를 안정적으로 다운로드할 수 있다고 발표했습니다. Jan 02, 2024 pm 03:54 PM

화웨이 공식 소식에 따르면, '개발자를 위한 모든 것'이라는 주제로 Open Atomic 개발자 컨퍼런스가 12월 16일부터 17일까지 이틀 동안 우시에서 열렸습니다. 이번 컨퍼런스는 Open Atomic Open Source Foundation인 화웨이가 주도했습니다. Inspur., ​​DaoCloud, Xieyun, Qingyun, Hurricane Engine은 물론 OpenSDV Open Source Alliance, openEuler 커뮤니티, OpenCloudOS 커뮤니티 및 기타 회원 단위가 공동으로 AtomHub Trusted Mirror Center 구축을 시작했습니다. 이는 공식 테스트를 위해 공개되었습니다. AtomHub는 공동 구축, 공동 거버넌스, 공유의 개념을 고수하며 오픈 소스 조직과 개발자에게 중립적이고 개방적이며 공동 구축된 신뢰할 수 있는 오픈 소스 컨테이너 미러 센터를 제공하는 것을 목표로 합니다. DockerHub와 같은 이미지 웨어하우스의 불안정성과 통제불가능성을 고려하여

JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 Nov 21, 2023 am 11:11 AM

JS 및 Baidu Maps를 사용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 개요: 웹 개발에서는 지리적 위치 및 지리적 정보를 표시하기 위해 지도 기능을 사용해야 하는 경우가 많습니다. 지도에서의 클릭 이벤트 처리는 지도 기능에서 일반적으로 사용되는 중요한 부분입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도의 클릭 이벤트 처리 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 단계: Baidu Map API 파일 가져오기 먼저 다음 코드를 통해 Baidu Map API 파일을 가져올 수 있습니다.

See all articles