On Mar 17, 4:07 pm, Nicholas <[email protected]> wrote:
> I have a gadget that works great on the iGoogle home page. However
> when you put it on the Gmail page there is much less space available
> and the gadget looks pretty bad. Is there any way for the gadget to
> detect properties of the container (size, etc) or detect the type of
> the container so that it can display itself differently?
Hi Nicholas,
I use code like this to detect container width:
function getWidth() {
return Math.max(document.body.scrollWidth,
document.body.offsetWidth);
};
As for sniffing out the platform, I've had good luck with detecting a
gadget running on GMail with
if (document.referer.search('//mail.google') > -1) {
... do gmail-specific handling
}
As usual, YMMV, but those snippets work for me.
String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iGoogle Developer Forum" 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-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---