PDA

View Full Version : Power Zoomer - hide cursor



portman
10-25-2012, 09:54 AM
Hi,

I'm using Image Power Zoomer v1.1.

It does just what I want it to do, but it would be nice to be able to hide the arrow cursor, or at the very least, change it to a crosshair which would be less obtrusive.

I tried using css rules without success. Any ideas?

Cheers
Ian

vwphillips
10-25-2012, 10:45 AM
Modify this function(change in red)


setupimage:function($, imgref, options){
var s=jQuery.extend({}, ddpowerzoomer.dsetting, options)
var $imgref=$(imgref)
imgref.info={ //create object to remember various info regarding image
power: {current:s.defaultpower, range:s.powerrange},
magdimensions: s.magnifiersize,
dimensions: [$imgref.width(), $imgref.height()],
coords: null
}
$imgref.unbind('mouseenter').mouseenter(function(e){ //mouseenter event over base image
var $magnifier=ddpowerzoomer.$magnifier
$magnifier.outer.css({width:s.magnifiersize[0], height:s.magnifiersize[1]}) //set magnifier's size
var offset=$imgref.offset() //get image offset from document
var power=imgref.info.power.current
$magnifier.inner.html('<img src="'+options.largeimagesrc+'" style="cursor:crosshair;"/>') //get base image's src and create new image inside magnifier based on it
$magnifier.image=$magnifier.outer.find('img:first')
.css({width:imgref.info.dimensions[0]*power, height:imgref.info.dimensions[1]*power}) //set size of enlarged image
var coords={left:offset.left, top:offset.top, right:offset.left+imgref.info.dimensions[0], bottom:offset.top+imgref.info.dimensions[1]}
imgref.info.coords=coords //remember left, right, and bottom right coordinates of image relative to doc
$magnifier.outer.show()
ddpowerzoomer.activeimage=imgref
})
},


or better?


setupimage:function($, imgref, options){
var s=jQuery.extend({}, ddpowerzoomer.dsetting, options)
var $imgref=$(imgref)
imgref.info={ //create object to remember various info regarding image
power: {current:s.defaultpower, range:s.powerrange},
magdimensions: s.magnifiersize,
dimensions: [$imgref.width(), $imgref.height()],
coords: null
}
$imgref.unbind('mouseenter').mouseenter(function(e){ //mouseenter event over base image
var $magnifier=ddpowerzoomer.$magnifier
$magnifier.outer.css({width:s.magnifiersize[0], height:s.magnifiersize[1]}) //set magnifier's size
var offset=$imgref.offset() //get image offset from document
var power=imgref.info.power.current
$magnifier.inner.html('<img src="'+options.largeimagesrc+'"/>') //get base image's src and create new image inside magnifier based on it
$magnifier.image=$magnifier.outer.find('img:first')
.css({width:imgref.info.dimensions[0]*power, height:imgref.info.dimensions[1]*power,cursor:'crosshair'}) //set size of enlarged image
var coords={left:offset.left, top:offset.top, right:offset.left+imgref.info.dimensions[0], bottom:offset.top+imgref.info.dimensions[1]}
imgref.info.coords=coords //remember left, right, and bottom right coordinates of image relative to doc
$magnifier.outer.show()
ddpowerzoomer.activeimage=imgref
})
},

portman
10-25-2012, 11:23 AM
Thank you Vic, that works perfectly,

Many thanks
Ian