So I'm trying to set up this jQuery CSS dock menu and you can enter in a proximity in the setup. The proximity determines when the zoom will be triggered, but you only get to put in one distance -- same for height and width. How can I change this code to allow to enter in a single one for height and a single one for width -OR- how can I just have one value entered in but have the vertical one cut in half? either one works... here's the bit of code that I think needs to be changed... if you need the whole thing let me know and I'll post the rest of it
jQuery(document).bind('mousemove', function(e) {
var pointer = jQuery.iUtil.getPointer(e);
var toAdd = 0;
if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'center')
var posx = pointer.x - el.fisheyeCfg.pos.x
- (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size())
/ 2 - el.fisheyeCfg.itemWidth / 2;
else if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'right')
var posx = pointer.x - el.fisheyeCfg.pos.x - el.offsetWidth
+ el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size();
else
var posx = pointer.x - el.fisheyeCfg.pos.x;
var posy = Math.pow(pointer.y - el.fisheyeCfg.pos.y - el.offsetHeight / 2, 2);
el.fisheyeCfg.items.each(function(nr) {
distance = Math.sqrt(Math.pow(posx - nr * el.fisheyeCfg.itemWidth, 2) + posy);
distance -= el.fisheyeCfg.itemWidth / 2;
distance = distance < 0 ? 0 : distance;
distance = distance > el.fisheyeCfg.proximity ? el.fisheyeCfg.proximity : distance;
distance = el.fisheyeCfg.proximity - distance;
extraWidth = el.fisheyeCfg.maxWidth * distance / el.fisheyeCfg.proximity;
this.style.width = el.fisheyeCfg.itemWidth + extraWidth + 'px';
this.style.left = el.fisheyeCfg.itemWidth * nr + toAdd + 'px';
toAdd += extraWidth;
});
jQuery.iFisheye.positionContainer(el, toAdd);
});
Any ideas?
Thanks,
Matt
I messed around with the script and ended up changing it a bit more than I planned.
You will now need to call the script using a few new parameters:
itemHeight
,proximityX
andproximityY
I didn't minify it, but here is the modified plugin in full: