Well done!

Here's another tid-bit if it's helpful...  The default size of any
gadget is 200 x 200, I believe.  This means that until your Gadget
(and your Gadget's image in this case) is loaded, the Gadget will
reserve that 200 x 200 space.  This may be much larger than the size
ultimately needed, causing some shifting in the initial loading.  Most
people don't worry about such things.  Unfortunately, I am far from
normal, so I do. :)

In any case, by using the "preferred_height" attribute, one can even
specify the default height of the gadget before its initial rendering:

<Content type="html" preferred_height="20"> ...


On Dec 1, 4:04 pm, jamogle <jamo...@gmail.com> wrote:
> 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 <jamo...@gmail.com> 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 google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to