-
Image flicker on browser resize
Hello, I have a problem with a flash gallery I purchased. I need the images in the gallery to not be cropped, so I've changed the image position function that is called when the browser is resized.
It all works except there’s a flicker when increasing the browser height once you’ve decreased the height. Does anyone have any advice? I'm a bit of a novice.
Here's a demo page:
http://workshop.c2clearcreative.co.u.../Main_Files_2/
And here's the function:
Code:
function setPositions () {
// - - - - - IF PICTURE VERTICAL - - - - -
if (imageContainer._height > imageContainer._width) {
if (imageContainer._width >= Stage.width - 20) {
imageContainer._width = Stage.width - 20;
imageContainer._yscale = imageContainer._xscale;
}
else {
imageContainer._height = Stage.height - 20;
imageContainer._xscale = imageContainer._yscale;
}
if (imageContainer._height >= Stage.height - 20) {
imageContainer._height = Stage.height - 20;
imageContainer._xscale = imageContainer._yscale;
}
else {
imageContainer._width = Stage.width - 20;
imageContainer._yscale = imageContainer._xscale;
}
}
// - - - - - IF PICTURE HORIZONAL - - - - -
if (imageContainer._height < imageContainer._width) {
if (imageContainer._height >= Stage.height - 20) {
imageContainer._height = Stage.height - 20;
imageContainer._xscale = imageContainer._yscale;
}
else {
imageContainer._width = Stage.width - 20;
imageContainer._yscale = imageContainer._xscale;
}
if (imageContainer._width >= Stage.width - 20) {
imageContainer._width = Stage.width - 20;
imageContainer._yscale = imageContainer._xscale;
}
else {
imageContainer._height = Stage.height - 20;
imageContainer._xscale = imageContainer._yscale;
}
}
//-------------------------------------------------------
imageContainer._x = Stage.width / 2 - imageContainer._width / 2;
imageContainer._y = Stage.height / 2 - imageContainer._height / 2;
}
-
Hi, Peterfs.
Thanks for your nice sharing. But I wonder how can I use these codes. Do I need another image resizer to help define the size of images? I am almost a green hand here. Any suggestion will be appreciated. Thanks in advance.
Best regards,
Arron
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|