Hello,

I'm using the scale effect and after scaling up, I'd like to scale
back down to the original size of the image.  I haven't found a way
that will get me back to the original image size using "percentage."
I've tried something like this:

var scaleFactor = 3.5;
unscaledImgWidth = $(".img").width();


//  scale up.
$(".img").effect("scale", { percent: (scaleFactor * 100) }, 600);


//  scale down.
$(".img").effect("scale", { percent: ((unscaledImgWidth / scaledWidth)
* 100) }, 600);

My scale down doesn't calculate out to be 100% accurate.  I have
absolutely positioned divs sitting on the image that act as clickable
areas (that align to the image below) to trigger the effect so after
they adjust their size and position, they need to line back up.

I've played with this for a couple of hours and I'm wondering if
there's another technical way to do this, or am up against more of a
math problem?  I'm wondering if I need to start with an image size and
scaleFactor that will produce whole numbers that won't get shortened
by JS.

Anyone been down this road?

Thanks,

David

Reply via email to