Interesting, I didn't realize that's what the Googley Eyes gadget did.  I
have to warn you that _IG_AddDOMEventHandler is certainly not a standard
part of the gadgets.* spec, so it's likely only to work on iGoogle (and I
can't say how long it'll be there for).
It may be interesting to propose a gadgets.addParentEventHandler method or
something to the spec group to make this more general.

~Arne




On Thu, Aug 27, 2009 at 2:53 PM, nolybab <thardin...@gmail.com> wrote:

>
> evgeny,
>
> this might even make it a bit easier....consider this revised code:
> //Use undocumented function to add top-level DOMEvent
> _IG_AddDOMEventHandle(document, "mousemove", yourfunction);
>
> //this is the function that gets called
> function yourfunction(b){
>
>  //for cross-browser compliance (i think)
>   if(!b){ b = window.event; }
>
>   //used to find offset of document from window
>   if(typeof(window.pageXOffset)=="number"){
>    e= window.pageXOffset;
>    f= window.pageYOffset
>   //used to find offset if scrolled
>   }else{
>    e= document.documentElement.scrollLeft;
>     f= document.documentElement.scrollTop;
>  }
>
>  //this should give you the x and y
>  var x=b.clientX + e;
>  var y=b.clientY + f;
> }
>
> This might at least help get you headed in the right direction
>
> hope this helps...
>
> --noly
>
> On Aug 7, 2:52 am, Evgeny Neumerzhitskiy <evgeny...@gmail.com> wrote:
> > Does anyone know how to track the mouse cursor when it's outside my
> > gadget's view? Document.onmousemove only works when the cursor is
> > inside my gadget.
> >
> > I found a gadget with eyes that track the mouse position, but it uses
> > render_inline="required" which is no longer supported, so I can't use
> > it.
> http://www.google.com/ig/directory?type=gadgets&url=www.google.com/ig...
> >
> > Thank you,
> >
> > Evgeny
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to