Javascript Help?

Timezone: Central Time (US & Canada) (GMT-06:00)
� Previous :: Next �
Javascript Help?
Friday, January 23rd, 2009 at 7:49 am
I have this function which does an image swap for me:

function animateMLR()
var images = new Array(10);
var maxImages = 99;
var myImages = new Array(10);
var imgPath = "photos/";
var imgPrefix = "img";
var imgSuffix = ".jpg";
var randomImageIndex = Math.floor(Math.random() * images.length);
document.getElementById('leftbottom').innerHTML='<img src="' + imgPath + imgPrefix + randomImageIndex + imgSuffix + '" width=163px  />'

So right now it outputs pictures as width=163px. What I'd like it to do is compare the height and width of the picture, and if width > height, then output pictures as height=163px instead. Any ideas?

Re: Javascript Help?
Tuesday, January 27th, 2009 at 4:03 am a workaround for this Smile

Realms ForumNon-Game DiscussionJavascript Help?