Dieser Artikel beschreibt die Methode, Bilder von JS zu vergrößern, zu reduzieren und zu ziehen. Teilen Sie es für Ihre Referenz wie folgt weiter:
var divid; var v_lef v_left = (document.body.clientwidth-width1)/2; v_top = (document.clientHeight-height1) /2;divid.style.left=V_LEFT;Divid.style.top=v_top;} Drag = 0; ISDRAG = false; var y, x; var odragobj; Funktion movemouse (e) {if (isdrag) {odragobj.style.top = (nn6? nty + e.clienty - y: nty + event.clienty - y) + "px"; odragobj.style.Ltx (Nnn6? Nn6? ntx + · klientx + × · · · · · × · kLAientx) (nn6? nn6? ntx + · klientx + · × · × · × · · · · · × × × × × · klientx + · klientx + · klientx + · klientx + · klientx + · klientx (nntx). . E.Target: event.srcelement; var topelement = "html"; while (odraghandle.tagname! = topelement && odraghandle.className! odraghandle.Parentnode: odraghandle.Parentelement;} if (odraghandle.className == "Dragable") {isdrag = true; odragobj = odraghandle; nty = parseInt (odragobj.style.top + 0); e.clienty: event.clienty; ntx = parseInt (odragobj.style.left + 0); x = nn6? E.ClientX: Ereignis.ClientX; document.onmousemove = moveMouse; // document.onmouseUp = mup; // Das Ereignis erfolgt, wenn die Maustaste veröffentlicht wird. parseInt (DragObj.style.top) + 100;} else {if (s == "down") {DragObj.style.top = parseInt (Dragobj.style.top) - 100;} else {if (s == ") {Dragobj.style "rechts") {Dragobj.style.left = parseInt (DragObj.Style.Left) - 100;}}}}}} // Schrinne mehrerer Funktion Smallit () {// // verkleinern Bild, loot Spot Height1 = Images1.Height; height; width1.width = bootions1.height1.height1.height1/1.1; 1.1;} // Zoomfunktion Bigit () {/*// das Bild zoomen, ohne Hot Spot var zoom = parseInt (Bilder1.Style.zoom, 10) || 100; Zoom += Ereignis. {Images1.Style.zoom = 100+"%"; Bilder1.Height = Images2.Height; Images1.width = Images2.Width; Divid.Style.Left = v_Left; Divid.style.top = v_top; = height1 / height2; var w = width1 / width2; if (height1 <height2 && width1 <width2) {images1.Height = height1; Bilder1.Width = width1;} else {if (h> w) {images1.Height2; Höhe1 * width2/width1;}} block1.style.left = 0; block1.style.top = 0;} // Mausrad -Zoom in und out function bbimg (o) {/ * var eleleft; var eletop; if (document.documentElement) {{ELELEFT = Dokument = Dokument. 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 (document.documentElement.scrolltop+"------ xxx"+Dokument). ParseInt (O.Style.zoom, 10) || 100; Zoom + = Ereignis.For more information about JavaScript related content, please check out the topics of this site: "JavaScript switching special effects and techniques summary", "JavaScript animation special effects and techniques summary", "JavaScript search algorithm skills summary", "JavaScript data structure and algorithm skills summary", "JavaScript traversal algorithm and techniques summary", "JavaScript operation skills Zusammenfassung "," JavaScript -Fehler und Debugging -Fähigkeiten Zusammenfassung "und" JavaScript Mathematical Operation Usage Zusammenfassung "
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.