JS to achieve image local amplification function __js

Source: Internet
Author: User

I found on the Internet better to enlarge the local picture effect of the JS code

First, the picture to enlarge the preview effect (the clearer the picture, enlarge it will be clearer):


Second, the picture local amplification effect:


Third, the CSS file code is as follows:

* * tianyi[days * Easy]*//* CSS class for zoomed area * *.

Magiczoombigimagecont {border:1px solid #91b817;} .
	Magiczoommain {Text-align:center!important;
width:10px; }

.

Magiczoommain Div {padding:0px!important;} /* Header look and feel CSS class///* header is shown if "title" are present in the <A> tag *.
	Magiczoomheader {font:10px Tahoma, Verdana, Arial, Sans-serif;
	Color: #fff;
	Background: #91b817; 
Text-align:center!important; }/* CSS class for small looking Glass square under mouse *.
	Magiczoompup {border:1px solid #aaa;
Background: #ffffff; }/* CSS style for loading animation box * *.
	magiczoomloading {text-align:center;
	Background: #ffffff;
	Color: #444;
	border:1px solid #ccc;
	opacity:0.8;
	padding:3px 3px 3px 3px!important; Display:none; /* Do don't edit this line please/* * CSS style for GIF image in the Loading animation box * *.
 magiczoomloading img {padding-top:3px!important;}

Four, JS file is as follows:

/* tianyi[days *]*/eval (function (p,a,c,k,e,d) {e=function (c) {return (c<a? ': E (parseint)) + (C/A) c=c%a? String.fromCharCode (c+29): C.tostring ())};if (! "). Replace (/^/,string)) {while (c--) {d[e (c)]=k[c]| | E (c)}k=[function (e) {return d[e]}];e=function () {return ' \\w+ '};c=1};while (c--) {if (K[c]) {p=p.replace (new RegExp (' \ B ' +e (c) + ' \\b ', ' G '), K[c]}}return p} (' 7 g=\ ' n\ '; 7 w=3g.3u.4q (); 6 (w.2q ("1L")!=-1) {g=\ ' 1l\ '}e 6 (w.2q ("N")!=-1) {g=\ ' n\ '}e 6 (w.2q ("1 B")!=-1) {g=\ ' 1b\ '}e 6 (w.2q ("")!=-1) {g=\ ' 1y\ ')}7 1v=1i (); c 1l (z) {o 9.4h (z)};c 2s (E) {6 (e.3k) {7 r=e.3k () ; 7 1x=0;7 1w=0;6 (9.12&& 9.12.1p| | 9.12.1o)) {1w=9.12.1o;1x=9.12.1p}e 6 (9.1b&& 9.1b.1p| | 9.1b.1o)) {1w=9.1b.1o;1x=9.1b.1p}o{\ ' m\ ': r.m+1x,\ ' t\ ': r.t+1w,\ ' 2b\ ': r.2b+1x,\ ' 1v\ ': R.1v+1w}}}c 2H (e) {7 x=0;7 y=0;6 (g==\ ' n\ ') {y=e.2f;x=e.2e;6 (9.12&&) (9.12.1p| | 9.12.1o)) {y=e.2f+9.12.1o;x=e.2e+9.12.1p}e 6 (9.1b&& 9.1b.1p| | 9.1b.1o)) {y=e.2f+9.1b.1o;x=e.2e+9.1b.1p}}e{y=e.2f;x=e.2e;y+=16.4m;x+=16.3l}o{\ ' x\ ': x,\ ' y\ ': Y}}c 2L () {O B};7 2t=c ( ) {7 1d=1m;6 (!1d[1]) 1d=[4,1d[0]];1m (7 2D 3H 1d[1]) 1d[0][2d]=1d[1][2d];o 1d[0]};c 1e (1n,t,1o) {6 (g==\ ' 1y\ ' | | G==\ ' 1l\ ' | | G==\ ' 1b\ ') {39{1n.3n (t,1o,b)}3o (e) {3W ("H 3Q: +e+", t= "+t")}}e 6 (g==\ ' n\ ') {1n.3j ("2O" +t,1o)}};c 2W (1n,t,1o) {6 (g==\ ' 1Y \'|| G==\ ' 1l\ ' | | G==\ ' 1b\ ') {1n.4r (t,1o,b)}e 6 (g==\ ' n\ ') {1n.3f ("2O" +t,1o)}};c 3l () {7 1p=[];1m (7 i=0;i<1m.18;i++) 1m (7 j=0;j<1m[i ].18;j++) 1p.2a (1m[i][j]); O 1p};c 3n (2m,3i) {1p=[];1m (7 i=3i;i<2m.18;i++) 1p.2a (2m[i)); 1p};c 1h (2t,3p) {7 1d=3n (1m,2); o C () {2t[3p].41 (2t,3l)) 1m,1d 1F (e) {6 (}};c ' g==\ ' | | G==\ ' 1b\ ' | | G==\ ' 1l\ ') {e.3t=m;e.40 (); e.3v ()}e 6 (g==\ ' n\ ') {16.t.3t=m}};c H (3s,3v,3z,3y,l) {4.2b=b;4.i=1l (3s); 4.l=1l (3v); 4.a=1l (3z); 4.q=1l (3y); 4.u=0;4.l=l;6 (!4.l["1R"]) {4.l["1R"]= ""}4.21=0;4.1u=0;4.13=0;4.x=0;4.1c=20;4.3p=20;4.1s=0;4.1r= 0;4.2x=\ ' 4.g=2g;6 (4.l["1I"]!=\ ') {4.g=9.v (\ ' 1c\ '); 4.g.5.n=\ ' 1x\ '; 4.g.5.1a=\ ' 1q\ '; 4.g.1g=\ ' 3j\ '; 4.g.5.2l=\ ' 2k\ '; 4.g.5.2u=\ ' 2y\ '; 4.g.2c=4.l["1J"]+\ ' <3t/><r 3x= ' 0 "2k=" \ ' +4.l["1J"]+\ ' "1f=" \ ' +4.l["1I"]+\ ' "/>\"; 4.I.Y (4.G)}4.3s=\' \ '; 4.2i=b;1v.2a (4); 4.2f=1h (4, "2h")}; H.11.3f=c () {2W (16.9, "I", 4.2F); 6 (4.l["n"]== "1Q") {1l (4.i.z+ " -2v"). 2Q (4.a)}}; H.11.2h=c (e) {7 y=0;7 x=0;r=2h (e); x=r[\ ' x\ '];y=r[\ ' y\ '];7 1j=0;7 1k=0;7 (p=4.l;27 "3b" p&&p.1t!= != "3c") {1j+=p.37;1k+=p.36; P=p.31}6 (g==\ ' n\ ') {r=2s (4.L); 1k=r[\ ' m\ ' the];1j=r[\ ' t\ ' (]}6 (x>f)) {1k+4.13 (); O B}6 (X<f (1k)) {4.28 (); O B}6 (Y>f (1j+4.x)) {4.28 (); O B}6 (Y<f (1j)) {4.28 (); O B}6 (g==\ ' n\ ') {4.i.5.1s=1}o M}; H.11.2e=c (e) {1F (e); 4.i.5.2g=\ ' 30\ '}; H.11.2w=c (e) {1F (e); 4.i.5.2g=\ ' 3o\ '}; H.11.29=c (e) {1F (e); 1m (i=0;i<1v.18;i++) {6 (1v[i]!=4) {1v[i].2h (E)}}6 (4.l&&4.l["1K"]==m) {6 (4.i.5.2g!=\ ') 30\ ') {o}}6 (4.2b) {o}6 (!4.2H (e)) {o}4.2b=m;7 2n=4.l;7 1k=0;7 1j=0;6 (g==\ ' 1y\ ' | | G==\ ' 1l\ ' | | G==\ ' 1b\ ') {7 p=2n;27 (p.1t!= "3b" &&p.1t!= "3c") {1j+=p.37;1k+=p.36; P=p.31}}e{r=2s (4.L); 1k=r[\ ' m\ '];1j=r[\ ' t\ ']}r=2h (E); X=r[\ ' x\ ',];y=r[\ ' y\ ' (];4.1s=x-1k;4.1r=y-1j;6) >=4.13) {4.1s=4.13-4.1c/2}6 (4.1R+4.1G/2) >=4.x) {4.1r=4.x-4.1g/2}6 ((4.1S-4.1C/2) <=0) {4.1s=4.1c/2}6 ((4.1r-4.1g/2) <=0) {4.1r=4.1g/2}2y (1h (4, "2r"), 10)}; H.11.2r=c () {4.u.5.m= (4.1S-4.1C/2) +\ ' o\ '; 4.u.5.t= (4.1R-4.1G/2) +\ ' o\ '; 4.u.5.1a= "2a"; 33=f (4.U.5.M) * (4.21/4.13); 32 =f (4.u.5.t) * (4.1u/4.x); 4.q.5.m= ( -33) +\ ' o\ '; 4.q.5.t= ( -32) +\ ' o\ '; 4.a.5.2l=\ ' 2k\ '; 4.a.5.1a=\ ' 2a\ '; 4.q.5.2l=\ ' 2k\ ' ; 4.q.5.1a=\ ' 2a\ '; 4.2b=b;4.a.5.m=4.2x};c 3d (2N) {7 2i= ""; 1m (i=0;i<2n.18;i++) {2i+=3i.3m (14^2n.3k (i))}o 2I}; H.11.28=c () {6 (4.l&&4.l["]==m") o;6 (4.u) {4.u.5.1a= "1q"}4.a.5.m=\ ' -1z\ '; 4.a.5.1a=\ ' 1q\ '; 6 (g==\ ' n\ ') {4. I.5.1s=0}}; H.11.2c=c () {4.1c= (f (4.A.5.D)-3)/(4.21/4.13); 6 (4.l&&4.l["1R"]!= "") {4.1g= (f (4.A.5.K) -3-19)/(4.1u/4.x)}E{ 4.1g= (F (4.A.5.K)-3)/(4.1u/4.x)}6 (4.1c>4.13) {4.1c=4.13}6 (4.1g>4.x) {4.1g=4.x}4.u.5.d=4.1c+\ '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y %\ '; f.5.2u=\ ' 2y\ '; f.2c=2x;4.a.y (f); F.5.m=\ ' u\ '; f.5.t=f (4.A.5.K) -20+\ ' o\ '}}; H.11.1h=c () {6 (4.g!=2g&&!4.q.2v&&4.l.d!=0&&4.l.k!=0) {4.g.5.m= (F (4.L.D)/2-F (4.G.4D)/2) +\ ' O\ '; 4.g.5.t= (F (4.L.K)/2-f (4.g.4e)/2) +\ ' o\ '; 4.g.5.1a=\ ' 2a\ '}6 (g==\ ' 1b\ ') {6 (!4.2i) {1e (4.Q, "3 A", 1h (4, "1H")); 4.2i =m;o}}e{6 (!4.q.2v| |! 4.L.2V) {2y (1h (4, "1H"), 1y); o}}4.21=4.Q.d;4.1u=4.q.k;4.13=4.l.d;4.x=4.l.k;6 (4.21==0| | 4.1u==0| | 4.13==0| | 4.x==0) {2y (1h (4, "1H"), 1y); O}6 (4.g!=2g) 4.g.5.1a=\ ' 1q\ '; 4.i.5.d=4.l.d+\ ' o\ '; 4.a.5.m=4.l.d+15+\ ' o\ '; 4.a.5.t=\ ' U\ ' 3e (4.l[\ ' n\ ']) {17\ ' m\ ': 4.a.5.m=\ '-\ ' + (15+f (4.a.5.d)) +\ ' o\ '; Z;17\ ' 1v\ ': 4.a.5.t=4.l.k+15+\ ' o\ '; 4.a.5.m=\ ' u\ '; Z;17\ ' t\ ': 4.a.5.t=\ '-\ ' + (15+f (4.A.5.K)) +\ ' o\ '; 4.a.5.m=\ ' u\ '; Z;17\ ' 1q\ ': 4.a.5.m=\ ' u\ '; 4.a.5.t=\ ' u\ '; Z;17\ ' 2z\ ': 4.a.5.m=\ ' u\ '; 4.a.5.t=\ ' u\ '; Z}4.2x=4.a.5.m;6 (4.u) {4.2C (); o}4.3x (); 4.3w (); 1e (16.9, "I", 4.2F); 1e (4.I, "", 1h (4, "I")); 6 (4.l&&4.l["1K "]==m" {1e (4.I, "2E", 1h (4, "2E")); 1e (4.I, "2w", 1h (4, "2w")); 4.1s=4.13/2;4.1r=4.x/2;4.2r ()}; H.11.2s=c (e,1e) {6 (1e.2m==4.q.1f) o;7 25=9.v ("1t"); 25.z=4.q.z;25.1f=1e.2m;7 p=4.q.46;p.47 (25,4.Q); 4.q=25;4.q.5.n=\ ' 26\ '; 4.l.1f=1e.3r;6 (1e.2p!=\ ' &&1l (\ ' 2d\ ' +4.a.z)) {1l (\ ' 2d\ ' +4.a.z). 2c=1e.2p}4.2i=b;4.1h ()};c (Z,J) { 7 8=16.9.2j ("A"); 1m (7 i=0;i<8.18;i++) {6 (8[i].1u==z) {1e (8[i], "2j", C (t) {6 (g!=\ ' n\ ') {4.3g ()}e{16.3h ()}1f (t); o B) 1e (8[i],j.l[\ ' 22\ '],1h (J, "2S", 8[i)); 8[i].5.3Q=\ ' 0\ '; 8[i].2o=2t;8[i].2o ({j:j,4t:c () {4.j.2s (2g,4)}}); 7 r=9.v ("1t"); R.1f=8[i].2m; R.5.n=\ ' 1x\ '; R.5.m=\ ' -1z\ '; R.5.t=\ ' -1z\ '; 9.12.Y (R); R=9.V ("1t"); R.1F=8[I].3R; R.5.n=\ ' 1x\ '; R.5.m=\ ' -1z\ '; R.5.t=\ ' -1z\ '; 9.12.Y (R)}}};c 4v () {(1v.18>0) {7 j=1v.4p (); J.3f ()}};c 3C () {7 1j=\ ' 4k 4j\ '; 7 1i=\ ' \ ' 7 1d=16.9.2j (' 1t '); 1m (7 i=0;i<1d.18;i++) {6 (/3j/.3b (1d[i].1g)) {6 (1d[i].2k !=\ ' \ ') 1j=1d[i].2k;1i=1d[i].1f; Z}}7 8=16.9.2j ("A"); 1m (7 i=0;i<8.18;i++) {6 (/h/.3b (8[i].1g)) {(8[i].1n) {6 (8[i].1n.1t!=\ ' 1t\ ') {8[i].2q ') (8[i].1n )}e{z}}6 (8[i].1n.1t!=\ ' 1t\ ') 4N "4n H 4o!"; 7 1z=3d.4m (3d.4l () *4q), 8[i].5.n= "8[i].5.2l=\", 2k\ ' 8[i].5.3q=\ '; 0\ ' 8[i].5.4u=\ '; 1e (3m\], "2j", C (T) {6 (8[i ' n\ ') {4.3g ()}e{16.3h ()}1f (T); o B); 6 (8[i].z==\ ' \ ') {8[i].z= "4s" +1z}6 (g==\ ' n\ ') {8[i].5.1s=0}7 2n=8[i].1n;2n.z= "3a" +1z;7 c=9.v ("1C"); c.z= "4i" +1z; Q=1i 1A (/s (\\s+):( \\s+)? (\\d+)/i); v=q.1w (8[i].1u); 7 s=50;6 (v) {s=f (v[3))}q=1i 1A (/45\\-43 (\\s+)?:( \\s+)? (2j|44)/i); v=q.1w (8[i].1u); 7 22=\ ' 2j\ '; 6 (v) {22=v[3]}q=1i 1A/j\\-d (\\s+)?:( \\s+)? (\\w+)/i); v=q.1w(8[I].1U); C.5.d=\ ' 3u\ '; 6 (v) {c.5.d=v[3]}q=1i 1A (/j\\-k (\\s+)?:( \\s+)? (\\w+)/i); v=q.1w (8[i].1u); C.5.k=\ ' 3u\ '; 6 (v) {c.5.k=v[3]}q=1i 1A (/j\\-n (\\s+)?:( \\s+)? (\\w+)/i); v=q.1w (8[i].1u); c.5.m=8[i].1n. D+15+\ ' o\ '; C.5.t=\ ' u\ '; 7 n=\ ' 2b\ '; 6 (v) {3e (v[3]) {17\ ' m\ ': n=\ ' m\ '; Z;17\ ' 1v\ ': n=\ ' 1v\ '; Z;17\ ' t\ ': n=\ ' t\ '; Z;17\ ' 1q\ ': n=\ ' 1q\ '; Z;17\ ' 2z\ ': n=\ ' 2z\ '; Z}}q=1i 1A (/4a\\-4f (\\s+)?:( \\s+)? (m| B)/I); v=q.1w (8[i].1u) 7 1k=b;6 (v) {6 (v[3]==\ ' m\ ') 1k=m}q=1i 1A (/4g\\-4b\\-j)?:( \\s+)? (m| B)/I); v=q.1w (8[i].1u); 7 23=b;6 (v) {6 (v[3]==\ ' m\ ') 23=m}c.5.2u=\ ' 1q\ '; C.1g= "4X"; c.5.1s=1y; C.5.1a=\ ' 1q\ '; 6 (n!=\ ' 1q\ ') {c.5.n=\ ' 1x\ '}e{c.5.n=\ 26\ '}7 ' 2p=9.v ' ("1t"); 2p.z= "+1z;2p.1f=8[i].2m"; C.Y (2p); 6 (n!=\ ' 1q\ ') {8[i]. Y (C)}e{1l (8[i].z+\ ' -2v\ '). Y (C)}7 l={23:23,1k:1k,1r:8[i].2p,s:s,22:22,n:n,1j:1j,1i:1i};7 j=1i H (8[i].z,\ ' 3a\ ' +1z,c.z,\ ' 35\ ') +1z,l ; 8[i].2o ({j:j}); J.1H () (8[i].z,j)}}};6 (g==\ ' n\ ') 39{9.3z ("3Y", B,m)}3o (e) {};1e (3 A, 3C); ', 62,313, ' | | | this|style|if|var|aels|document|bigimagecont| | function| | | | magiczoom_ua| | | | | settings|left|position|return| | bigimage| | | top|pup|matches| | | | id| | False|bigcont|width|else|parseint|loadingcont| magiczoom|smallimagecont|zoom|height|smallimage|true|msie|px|tag|re|img|opacity|event|0px|createelement| | smallimagesizey|appendchild|break| | prototype|body|smallimagesizex| | | window|case|length| | visibility|documentelement|popupsizex|args| magiczoom_addeventlistener|src|popupsizey| magiczoom_createmethodreference|new|smally|smallx|_el|for|firstchild|scrolltop|scrollleft|hidden|positiony| Positionx| img|rel| magiczoom_zooms|exec|absolute|100|rand| regexp|safari| div|iels|ael| magiczoom_stopeventpropagation|classname|initzoom|loadingimg|loadingtext|drag_mode|opera|arguments|obj| listener|result|custom|header|zindex|tagname|bigimagesizey|bottom|wy|wx|gecko|10000px| | bigimagesizex|thumb_change|bigimage_always_visible|ar1|newbigimage|relative|while|hiderect|mousemove|visible| recalculating|innerhtml| Magiczoomheader|clientx|clienty|null|checkcoords|safarionloadstarted|click|block|display|href|smallimg|mzeXtend|bigimg|indexof|showrect| magiczoom_getbounds| Magiczoom_extendelement|overflow|complete|mouseup|bigimagecontstyleleft|settimeout|inner|push|right| recalculatepopupdimensions|property|mousedown|checkcoords_ref|cursor| Magiczoom_geteventbounds|vc68|getelementsbytagname|alt| Magicview_ia|sequence|vc67|on|title|removechild|parsefloat|replacezoom|object|textalign|big| Magiczoom_removeeventlistener|str|center|filter|move|offsetparent|pery|perx|bigimgsrc|bim|offsetleft|offsettop | magiczoom_findselectors|try|sim| body| html|xgdf7fsgd56|switch|stopzoom|blur|focus|skip| Magiczoomloading|getboundingclientrect| magiczoom_concat|none| Magiczoom_withoutfirst|catch|methodname|outline|rev|smallimagecontid|cancelbubble|300px|smallimageid|initpopup |initbigcontainer|bigimageid|bigimagecontid|load|test| magiczoom_findzooms| math| magiczoompup|detachevent|navigator|in| string|attachevent|charcodeat|pagexoffset|fromcharcode|addeventlistener|default|popupsizey|error|moz|baseuri| Br|useragent|stoppropagation|alert|border| backgroundimagecache|execcommand|preventdefault|apply|bko|change|mouseover|thumb|parentnode|replacechild| array|mozilla|drag|show| tahoma|offsetwidth|offsetheight|mode|always|getelementbyid|bc| Zoom| loading|random|round| invalid|invocation|pop|1000000|removeeventlistener|sc|selectthiszoom|textdecoration| Magiczoom_stopzooms|fontfamily|10px| Microsoft| dximagetransform| alpha|frameborder|3px|padding|progid| iframe| opacity|alpha|unselectable| mozuserselect|oncontextmenu|onselectstart|pageyoffset|throw| taac| coigm|tolowercase|color|fontsize|cccccc|html|ah|ojk| magiczoombigimagecont|ga|za| |
 Bb|xk '. Split (' | '), 0,{})
Five, HTML code

 



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.