great, thanks
On 1/2/06, Michael Zachariassen Krog <mic-njz39FWuq6g@public.gmane.org>
wrote:>
> Hi Tarek.
>
> No its not. But theres an easy workaround. The following code may not
> execute
> as its not tested in a browser, just written from the back of my head. :-)
>
> Here it goes:
> ----------------------
> <script>
> var System={
> Mouse:{
> _x=0,
> _y=0,
> getX:function(){return this._x;},
> getY:function(){return this._y;},
> refresh:function(e){
> if (!e) var e = window.event;
> if (e.pageX || e.pageY)
> {
> System.Mouse._x = e.pageX;
> System.Mouse._y = e.pageY;
> }
> else if (e.clientX || e.clientY)
> {
> System.Mouse._x = e.clientX + document.body.scrollLeft;
> System.Mouse._y = e.clientY + document.body.scrollTop;
> }
> }
> }
> }
>
> window.onmousemove=System.Mouse.refresh;
> </script>
> -------------------
>
> The you should alwas be able to get mouse cords by using
System.Mouse.getX()
> and System.Mouse.getY().
>
> Bst Regards
> Michael Krog
>
>
> Den 02/01/2006 kl. 14.14 skrev Tarek Ziadé:
>
> Hello,
>
> Is it possible somehow to get mouse coordinates without using the event
> mechanism ?
> I need to get the current mouse position to initialize some div position,
> but not at page load
>
> Tarek
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
--
Tarek Ziadé | www.afpy.org
Python - why settle for snake oil when you can have the whole snake?
(Mark Jackson)
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs