注:此文章不是本人原创。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ImageZoom 图片放大效果</title>
<script>eval_r(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?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}('5 $$,$$B,$$A,$$F,$$D,$$E,$$S;(3(){5 O,B,A,F,D,E,S;O=3(id){4"1R"==1y id?G.getElementById(id):id};O.emptyFunction=3(){};O.extend=3(H,Z){I(5 N P Z){H[N]=Z[N]}4 H};O.deepextend=3(H,Z){I(5 N P Z){5 17=Z[N];9(H===17)continue;9(1y 17==="c"){H[N]=C.callee(H[N]||{},17)}J{H[N]=17}}4 H};O.wrapper=3(me,1T){5 1z=3(){me.Q(11,C)};5 1A=3(){};1A.18=1T.18;1z.18=new 1A;4 1z};B=(3(K){5 b={12:/12/.x(K)&&!/1B/.x(K),1B:/1B/.x(K),1U:/webkit/.x(K)&&!/1C/.x(K),1V:/1V/.x(K),1C:/1C/.x(K)};5 1j="";I(5 i P b){9(b[i]){1j="1U"==i?"19":i;1D}}b.19=1j&&1E("(?:"+1j+")[\\\\/: ]([\\\\d.]+)").x(K)?1E.$1:"0";b.ie=b.12;b.1W=b.12&&1G(b.19,10)==6;b.ie7=b.12&&1G(b.19,10)==7;b.1X=b.12&&1G(b.19,10)==8;4 b})(1H.navigator.userAgent.toLowerCase());A=3(){5 k={isArray:3(1Y){4 Object.18.toString.1k(1Y)==="[c 1Z]"},1l:3(v,R,f){9(v.1l){4 1m(f)?v.1l(R):v.1l(R,f)}J{5 L=v.1a;f=1m(f)?0:f<0?1n.20(f)+L:1n.21(f);I(;f<L;f++){9(v[f]===R)4 f}4-1}},1o:3(v,R,f){9(v.1o){4 1m(f)?v.1o(R):v.1o(R,f)}J{5 L=v.1a;f=1m(f)||f>=L-1?L-1:f<0?1n.20(f)+L:1n.21(f);I(;f>-1;f--){9(v[f]===R)4 f}4-1}}};3 X(c,r){9(undefined===c.1a){I(5 j P c){9(w===r(c[j],j,c))1D}}J{I(5 i=0,L=c.1a;i<L;i++){9(i P c){9(w===r(c[i],i,c))1D}}}};X({22:3(c,r,q){X(c,3(){r.Q(q,C)})},map:3(c,r,q){5 k=[];X(c,3(){k.23(r.Q(q,C))});4 k},1p:3(c,r,q){5 k=[];X(c,3(24){r.Q(q,C)&&k.23(24)});4 k},every:3(c,r,q){5 k=1b;X(c,3(){9(!r.Q(q,C)){k=w;4 w}});4 k},some:3(c,r,q){5 k=w;X(c,3(){9(r.Q(q,C)){k=1b;4 w}});4 k}},3(25,j){k[j]=3(c,r,q){9(c[j]){4 c[j](r,q)}J{4 25(c,r,q)}}});4 k}();F=(3(){5 1c=1Z.18.1c;4{bind:3(1q,q){5 1r=1c.1k(C,2);4 3(){4 1q.Q(q,1r.26(1c.1k(C)))}},bindAsEventListener:3(1q,q){5 1r=1c.1k(C,2);4 3(g){4 1q.Q(q,[E.1d(g)].26(1r))}}}})();D={1s:3(m){5 13=m?m.27:G;4 13.28.29||13.2a.29},1t:3(m){5 13=m?m.27:G;4 13.28.2b||13.2a.2b},2c:G.1e?3(a,b){4!!(a.compareDocumentPosition(b)&16)}:3(a,b){4 a!=b&&a.2c(b)},u:3(m){5 o=0,M=0,T=0,U=0;9(!m.2d||B.1X){5 n=m;while(n){o+=n.offsetLeft,M+=n.offsetTop;n=n.offsetParent};T=o+m.offsetWidth;U=M+m.offsetHeight}J{5 u=m.2d();o=T=D.1t(m);M=U=D.1s(m);o+=u.o;T+=u.T;M+=u.M;U+=u.U};4{"o":o,"M":M,"T":T,"U":U}},clientRect:3(m){5 u=D.u(m),1I=D.1t(m),1J=D.1s(m);u.o-=1I;u.T-=1I;u.M-=1J;u.U-=1J;4 u},curStyle:G.1e?3(p){4 G.1e.2e(p,2f)}:3(p){4 p.1u},getStyle:G.1e?3(p,j){5 h=G.1e.2e(p,2f);4 j P h?h[j]:h.getPropertyValue(j)}:3(p,j){5 h=p.1u;9(j=="Y"){9(/1K\\(Y=(.*)\\)/i.x(h.1p)){5 Y=parseFloat(1E.$1);4 Y?Y/2g:0}4 1};9(j=="2h"){j="2i"}5 k=h[j]||h[S.1L(j)];9(!/^\\-?\\d+(px)?$/i.x(k)&&/^\\-?\\d/.x(k)){h=p.h,o=h.o,2k=p.1M.o;p.1M.o=p.1u.o;h.o=k||0;k=h.pixelLeft+"px";h.o=o;p.1M.o=2k}4 k},setStyle:3(1f,h,14){9(!1f.1a){1f=[1f]}9(1y h=="1R"){5 s=h;h={};h[s]=14}A.22(1f,3(p){I(5 j P h){5 14=h[j];9(j=="Y"&&B.ie){p.h.1p=(p.1u.1p||"").2l(/1K\\([^)]*\\)/,"")+"1K(Y="+14*2g+")"}J 9(j=="2h"){p.h[B.ie?"2i":"cssFloat"]=14}J{p.h[S.1L(j)]=14}}})}};E=(3(){5 1g,1h,15=1;9(1H.2m){1g=3(t,l,y){t.2m(l,y,w)};1h=3(t,l,y){t.removeEventListener(l,y,w)}}J{1g=3(t,l,y){9(l==="2n")l="2o";9(!y.$$15)y.$$15=15++;9(!t.V)t.V={};5 W=t.V[l];9(!W){W=t.V[l]={};9(t["on"+l]){W[0]=t["on"+l]}}W[y.$$15]=y;t["on"+l]=1v};1h=3(t,l,y){9(l==="2n")l="2o";9(t.V&&t.V[l]){delete t.V[l][y.$$15]}};3 1v(){5 1w=1b,g=1d();5 W=11.V[g.l];I(5 i P W){11.$$1v=W[i];9(11.$$1v(g)===w){1w=w}}4 1w}}3 1d(g){9(g)4 g;g=1H.g;g.pageX=g.clientX+D.1t(g.1O);g.pageY=g.clientY+D.1s(g.1O);g.target=g.1O;g.1P=1P;g.1Q=1Q;5 1x={"mouseout":g.toElement,"mouseover":g.fromElement}[g.l];9(1x){g.1x=1x}4 g};3 1P(){11.cancelBubble=1b};3 1Q(){11.1w=w};4{"1g":1g,"1h":1h,"1d":1d}})();S={1L:3(s){4 s.2l(/-([a-z])/ig,3(all,2p){4 2p.toUpperCase()})}};9(B.1W){try{G.execCommand("BackgroundImageCache",w,1b)}catch(e){}};$$=O;$$B=B;$$A=A;$$F=F;$$D=D;$$E=E;$$S=S})();',[],150,'|||function|return|var||||if|||object|||from|event|style||name|ret|type|node||left|elem|thisp|callback||element|rect|array|false|test|handler||||arguments||||document|destination|for|else|ua|len|top|property||in|apply|elt||right|bottom|events|handlers|each|opacity|source||this|msie|doc|value|guid||copy|prototype|version|length|true|slice|fixEvent|defaultView|elems|addEvent|removeEvent||vMark|call|indexOf|isNaN|Math|lastIndexOf|filter|fun|args|getScrollTop|getScrollLeft|currentStyle|handleEvent|returnValue|relatedTarget|typeof|ins|subclass|opera|chrome|break|RegExp||parseInt|window|sLeft|sTop|alpha|camelize|runtimeStyle||srcElement|stopPropagation|preventDefault|string||parent|safari|firefox|ie6|ie8|obj|Array|ceil|floor|forEach|push|item|method|concat|ownerDocument|documentElement|scrollTop|body|scrollLeft|contains|getBoundingClientRect|getComputedStyle|null|100|float|styleFloat||rsLeft|replace|addEventListener|DOMMouseScroll|mousewheel|letter'.split('|'),0,{}))</script>
<script>
var ImageZoom = function(image, viewer, options) {
};
ImageZoom.prototype = {