PDA

View Full Version : Image Size Width/Height onLoad problem



iamfreebiewoman
05-04-2005, 06:49 PM
Hi, I need some assistance on the following bit of code please:

<a href="http://www.mywebsite.com/images/" target=_new>
<img border=1 src="image1.jpg" name='SlideShow' width=200 height=300></a>

This code is a portion of a larger code that uses a body onLoad call to display a series of images. The code above defines the width and height of all the images that will display in the code. The problem with that is, I cannot resize my images because of distortion and the images are of varying dimensions, so I need this portion of the code to also not define the width and height, but instead I need to code it to detect the width and height so that all of the images show up at their original dimensions. Any ideas on how to do this?

Any assistance would be appreciated!

as always,
Rebecca Wood

jscheuer1
05-05-2005, 06:00 AM
I'd feel more comfortable commenting on this if I could see the script in action, the complete source code and your best attempt at making it do what you want it to do. That being said, many slideshows do not bother trying to determine the size of images. As long as none of the images are outrageously large, you should be able to simply remove the dimensions from your tag like so:


<a href="http://www.mywebsite.com/images/" target=_new>
<img border=1 src="image1.jpg" name='SlideShow'></a>This, depending upon the layout of the rest of your page, may cause alot of jumping around of other content on the page. There are ways to prevent that if it occurs, also depending upon the layout. Often, enclosing the whole thing inside a table with dimensions set to the largest width and the largest height plus a few pixels will do it (this may require some trickery for Mozilla based browsers like NS and FF). One thing you may not have considered is actually cropping and/or resizing your images in a paint or image program so that they are all the same dimensions. This will result in a more pleasing display than any successful effort at displaying disparately sized images in a slideshow will.

iamfreebiewoman
05-05-2005, 07:44 AM
Thanks for the post John... your recommendation was right on the money on how to fix it... greatly appreciated!

For my original thought of what I was going to use it for... it won't work LOL however, I have done some thinking and have found another use for the code.. and for that use, the images are all the same dimensions so it will work quite nicely for that and I won't have the distortion factor to worry about....

While I have you... LOL... the other problem I have is with the older version of OverLib (V2.22). (I KNOW the easy answer to that would be to suggest I upgrade to his newest version wich is 4.something but, when I tried that, it won't work for me with my browser settings so I know it won't work for my visitors either because I lay odds on the fact that most of them run the same tight security settings that I do with ActiveX disabled and every popup blocker known to man running LOL...) Can you tell me where would be an appropriate place to post about an OverLib box display problem with that code? I have tried to email the programmer about it and his mail bounced back to me :-( and I joined his Yahoo support group and nobody has replied to me and its been a while... the issue I am having with that code I have been trying to fix for 2 years and can't get it right yet LOL how frustrating! (although I did venture through his site enough to figure out how to make the OverLib call image previews with the V2.22 version of the code <yay me lol>). I would really LOVE to fix the problem I have with it because I have a use for it in other places on my site but because of the problem I can't use it until I can figure out how to fix the display problems after the user has scrolled down the page, the OverLib box will display off the page... it is reading by X and Y axis of 0,0 and no matter what I change I cannot seem to make it work like OverLib's site does, when you mouse over even if you have scrolled, the OverLib boxes display fine right where they are suppose to and mine never have LOL... I have a thorough set of notes on what it does and I have a page on my site with the code on it, I just don't want to post it in the wrong place and get my knuckles cracked or something LOL.... (btw, the OverLib I have V2.22 is JS based and calles the overlib.js file, so would it be ok to post that here in the JS forum? I would need to also in that post link to the page on my site where I use the script currently, just making sure that wouldn't be a problem before I post...)

Thanks in advance for any advice you can provide on where would be an appropriate place to post and try to get help on this... it's been chapping me for 2 years now LOL....

as always,
Rebecca Wood

jscheuer1
05-05-2005, 08:24 AM
Do you always laugh so much? lol Anyways, I used to use overlib, I forget what version it was but the code was so huge, even with the overlibmini version. I switched to Cool DHTML tooltip script II (http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm) which served my purposes with much less code. I don't think you need to worry about posting in the wrong forum here, the penalty seems to be having your post unceremoniously moved to the appropriate forum. Besides, unless the version of overlib you are seeking advice on is a current Dynamic Drive script, I see no reason why it wouldn't belong in this forum.