이 기사에서는 JS의 사진 확대, 축소 및 드래그하는 방법에 대해 설명합니다. 다음과 같이 참조에 대해 공유하십시오.
var divid; var v_left; var v_top; window.onload = function () {divid = docut v_left = (document.body.clientWidth1)/2; v_top = (document.body.clientHeight-height1) /2; divid.style.left=v_left;divid.style.top=v_top;} drag = 0; // drag object var ie = document.all; var nn6 = document.get.geteMendE. isdrag = false; var y, x; var odragobj; function movemouse (e) {if (isdrag) {odragobj.style.top = (nn6? nty + e.clienty - y : nty + event.clienty -y) + "px"; odragobj.style.left = (nn6? ntx + e.clientx - x : ntx. x) + "px"; return false;}} // 드래그 메소드 함수 initdrag (e) {var odraghandle = nn6? e.target : event.srcelement; var toplement = "html"; while (odraghandle.tagname! = toplement && odraghandle.classname! = "dragable") {odraghandle = nn6? odraghandle.parentNode : odraghandle.parentElement;} if (odraghandle.classname == "dragable") {isdrag = true; odragobj = odraghandle; nty = parseint (odragobj.style.top + 0); y = nn6? e.clienty : event.clienty; ntx = parseint (odragobj.style.left + 0); x = nn6? e.clientx : event.clientx; document.onmouseMove = movemouse; // document.onmouseup = mup; // 마우스 버튼이 릴리스 될 때 이벤트가 발생합니다. parseint (dragobj.style.top) + 100;} else {if (s == "down") {dragobj.style.top = parseint (dragobj.style.top) -100;} else {if (s == "left") {dragobj.style.left = parseint (dragobj.style.style.left) + 100; {dragobj.style.left = parseint (dragobj.style.left) -100;}}}}}} // 다중 함수 smallit () {// 핫 스팟 높이 1 = images 1 = images 1.Height; width1 = images 1.width; images1.Height1/1; bigit () {/*// 핫 스팟 var var Zoom = parseint (images1.style.zoom, 10) || 100; Zoom += event.wheeldelta/ 12; if (Zoom> 0) {images1.style.zoom = (Zoom +10) +"%";} * // hotspot height1 = images1.height; width1 = images 1.width; images 1. height1 * 1.1.width =} // reth1 * 1.1;}; realsize () {images1.style.zoom = 100+"%"; images1.height = images2.height; images1.width = images2.width; divid.style.left = v_left; divid.style.top = v_top;} 함수 featsize () {var width1 = image2.width; var theight1 = image2.height. = 200; var h = height1 / higher2; var w = width1 / width2; if (height1 <height2 && width1 <width2) {images1.height = height1; images1.width = width1;} else {if (h> w) {images1.height = geight2; images 1.width = height1; width2; images1.height = height1 * width2/width1;}} block1.style.left = 0; block1.style.top = 0;} // mouse 휠을 확대하고 기능 bbimg (o) {/ * var eletop; if (document.documenteT) document.documentElement.scrolltop;} else {eleleft = document.body.scrollleft; eletop = document.body.scrolltop;} v_left+= eleleft; v_top+= eletop; // divid.style.left = v_left; // divid.style.top = v_top; alert (documentelement.scrolltop+"----- xxx"+document.body.scrolltop+window.pageyoffset) parseint (o.style.zoom, 10) || 100; Zoom + = event.wheeldelta / 12; if (Zoom> 0) {O.style.zoom = Zoom + "%";} return false;}JavaScript 관련 컨텐츠에 대한 자세한 내용은이 사이트의 주제를 확인하십시오. "JavaScript Switching 특수 효과 및 기술 요약", "JavaScript Splegymation 특수 효과 및 기술 요약", "JavaScript 검색 알고리즘 기술 요약", "JavaScript 구조 및 알고리즘 스킬", "Javascript Sciretm 및 Techniques Suckes" "" "" "Javascript Skills" "" "" 요약 ","JavaScript 오류 및 디버깅 기술 요약 "및"JavaScript 수학적 작업 사용 요약 "
이 기사가 모든 사람의 JavaScript 프로그래밍에 도움이되기를 바랍니다.