Download files
(Function ($) {$. FN. jqueryzoom = function (options) {var settings = {xzoom: 200, yzoom: 200, offset: 10, position: "right", lens: 1, preload: 1 }; if (options) {$. extend (settings, options)} var noalt = ''; $ (this ). hover (function () {var imageleft = $ (this ). offset (). left; var imagetop = $ (this ). offset (). top; var imagewidth = $ (this ). children ('img '). get (0 ). offsetwidth; var imageheight = $ (this ). children ('img '). get (0 ). offsetheight; noalt = $ (Th Is ). children ("IMG "). ATTR ("Alt"); var bigimage = $ (this ). children ("IMG "). ATTR ("jqimg"); $ (this ). children ("IMG "). ATTR ("Alt", ''); if ($ (" Div. zoomdiv "). get (). length = 0) {$ (this ). after ("<Div class = 'zoomdiv '> </div> "); $ (this ). append ("<Div class = 'jqzoompup'> & nbsp; </div>")} If (settings. position = "right") {If (imageleft + imagewidth + settings. offset + settings. xzoom> screen. width) {le Ftpos = imageLeft-settings.offset-settings.xzoom} else {leftpos = imageleft + imagewidth + settings. offset }}else {leftpos = imageLeft-settings.xzoom-settings.offset; If (leftpos <0) {leftpos = imageleft + imagewidth + settings. offset }}$ ("Div. zoomdiv ").css ({top: imagetop, left: leftpos}); $ (" Div. zoomdiv "). width (settings. xzoom); $ ("Div. zoomdiv "). height (settings. yzoom); $ ("Div. zoomdiv "). show (); If (! Settings.lens?##(this=.css ('cursor ', 'crosshair')} $ (document. body ). mousemove (function (e) {mouse = new mouseevent (E); var bigwidth = $ (". bigimg "). get (0 ). offsetwidth; var bigheight = $ (". bigimg "). get (0 ). offsetheight; var scaley = 'X'; var scalex = 'y'; If (isnan (scalex) | isnan (scaley) {var scalex = (bigwidth/imagewidth ); vaR scaley = (bigheight/imageheight); $ ("Div. jqzoompup "). width (settings. xzoom)/scalex); $ ("Div. jqzoompup" ). Height (settings. yzoom)/scaley); If (settings. lens) {$ ("Div. jqzoompup ").css ('visibility ', 'visable')} xpos = mouse. x-$ ("Div. jqzoompup "). width ()/2-imageleft; ypos = mouse. y-$ ("Div. jqzoompup "). height ()/2-imagetop; If (settings. lens) {xpos = (mouse. x-$ ("Div. jqzoompup "). width ()/2 <imageleft )? 0 :( mouse. x + $ ("Div. jqzoompup"). Width ()/2> imagewidth + imageleft )? (Imagewidth-$ ("Div. jqzoompup "). width ()-2): xpos; ypos = (mouse. y-$ ("Div. jqzoompup "). height ()/2 <imagetop )? 0 :( mouse. Y + $ ("Div. jqzoompup"). Height ()/2> imageheight + imagetop )? (Imageheight-$ ("Div. jqzoompup "). height ()-2): ypos} If (settings. lens) {$ ("Div. jqzoompup ").css ({top: ypos, left: xpos})} scrolly = ypos; $ (" Div. zoomdiv "). get (0 ). scrolltop = scrolly * scaley; scrollx = xpos; $ ("Div. zoomdiv "). get (0 ). scrollleft = (scrollx) * scalex})}, function () {$ (this ). children ("IMG "). ATTR ("Alt", noalt); $ (document. body ). unbind ("mousemove"); If (settings. lens) {$ ("Div. jqzoompup "). remove ()} $ ("Div. zoomdiv "). remove ()}); Count = 0; If (settings. preload) {$ ('body '). append ("<Div style = 'display: none; 'class = 'jqpreload" + Count + "'> sdsdssdsd </div>"); $ (this ). each (function () {var imagetopreload = $ (this ). children ("IMG "). ATTR ("jqimg"); var compile (content + '')}) }} (jquery ); function mouseevent (e) {This. X = E. pagex; this. y = E. pagey}