function zoom(mask, bigimg, smallimg) { this.bigimg = bigimg; this.smallimg = smallimg; this.mask = mask } zoom.prototype = { init: function() { var that = this; this.smallimgClick(); this.maskClick(); this.mouseWheel() }, smallimgClick: function() { var that = this; $("." + that.smallimg).click(function() { $("." + that.mask).fadeIn(); $("." + that.bigimg).attr("src", $(this).attr("src")).fadeIn() }) }, maskClick: function() { var that = this; $("." + that.mask).click(function() { $("." + that.bigimg).fadeOut(); $("." + that.mask).fadeOut() }) }, };