', w / 3, (w / 2) - (w / 6))).find(':last').css('opacity', 0.5) } }, 200); var ie6FixRemove = function () { if ($ie6Fix !== null) { $ie6Fix.remove(); $ie6Fix = null } }; this.removeBits = function () { if (lens) { lens.remove(); lens = null } if ($tint) { $tint.remove(); $tint = null } if (softFocus) { softFocus.remove(); softFocus = null } ie6FixRemove(); $('.cloud-zoom-loading', jWin.parent()).remove() }; this.destroy = function () { jWin.data('zoom', null); if ($mouseTrap) { $mouseTrap.unbind(); $mouseTrap.remove(); $mouseTrap = null } if (zoomDiv) { zoomDiv.remove(); zoomDiv = null } this.removeBits() }; this.fadedOut = function () { if (zoomDiv) { zoomDiv.remove(); zoomDiv = null } this.removeBits() }; this.controlLoop = function () { if (lens) { var x = (mx - sImg.offset().left - (cw * 0.5)) >> 0; var y = (my - sImg.offset().top - (ch * 0.5)) >> 0; if (x < 0) { x = 0 } else if (x > (sImg.outerWidth() - cw)) { x = (sImg.outerWidth() - cw) } if (y < 0) { y = 0 } else if (y > (sImg.outerHeight() - ch)) { y = (sImg.outerHeight() - ch) } lens.css({left: x, top: y}); lens.css('background-position', (-x) + 'px ' + (-y) + 'px'); destU = (((x) / sImg.outerWidth()) * zoomImage.width) >> 0; destV = (((y) / sImg.outerHeight()) * zoomImage.height) >> 0; currU += (destU - currU) / opts.smoothMove; currV += (destV - currV) / opts.smoothMove; zoomDiv.css('background-position', (-(currU >> 0) + 'px ') + (-(currV >> 0) + 'px')) } controlTimer = setTimeout(function () { ctx.controlLoop() }, 30) }; this.init2 = function (img, id) { filesLoaded++; if (id === 1) { zoomImage = img } if (filesLoaded === 2) { this.init() } }; this.init = function () { $('.cloud-zoom-loading', jWin.parent()).remove(); $mouseTrap = jWin.parent().append(format("