I found a solution.

By putting the gadgets.window.adjustHeight(); within the img tag, it
gets run each time you change the src argument.

<img src="stuffhere" onload="gadgets.window.adjustHeight();" >

No need to hold up the flow of the script white the image loads
-james

On Dec 1, 12:35 pm, jamogle <[email protected]> wrote:
> Hi All,
>
> I'm writing a gadget in javascript for inserting an image from the
> smugmug image sharing site, it displays captions, links and exif along
> with the photo within a wave. I'm having some issues with the dynamic
> height options for the wave where it updates the height before the
> image is fully loaded so it chops off the image.
>
> I'm loading the image into a pre existing img tag using the return
> value of smugmug's JSON api which gives me the image path and then
> calling the function to adjust the height of the gadgets container:
>
>     document.getElementById('mainImgLoc').src= obj.data.Image
> ["SmallURL"];
>     gadgets.window.adjustHeight();
>
> Is there a way to wait for the image to load before updating the
> height of the gadget? I thought about setting the height in the image
> tag, but that changes for each image and I don't have access to the
> dimensions of the image through their api.
>
> Cheers
> -James

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to