[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-28 Thread Andrea Giammarchi
Hi Diego, the onmouseover is activated as you said but only if the body is present. Since the doScroll trick works over an interval, I am partially sure that onmouseover will be fired alwasy before that interval. document.documentElement.attachEvent(onmouseover, function(){

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-28 Thread Andrea Giammarchi
Since the doScroll trick works over an interval, I am partially sure that onmouseover will be fired alwasy before that interval. tested right now, it is not true ... there is no way to predict who is executed before but for sure the onmouseover event is fired only once while the interval could

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-28 Thread Andrea Giammarchi
last thing ... the onload could obviously be simply something like this: attachEvent(onload, function(){ fireTheOnmouseOverEvent :-) }); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery Development group.

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread d3r1v3d (Gavin Mulligan)
Yes, but that requires the 'mouseover' event to be executed; which, in turn, requires that a user move their mouse over the page at least a pixel for it to trigger. I believe Marcus was asking if it was possible to retrieve a user's current mouse position without moving the cursor at all. -

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread d3r1v3d (Gavin Mulligan)
You're right, it does seem to work in IE 7. However, it still fails to work in Firefox and Chrome... - Gavin On Feb 27, 11:42 am, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I tested in IE :D On Fri, Feb 27, 2009 at 2:20 PM, d3r1v3d (Gavin Mulligan) vtga...@gmail.com wrote:

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread Diego Perini
Gavin, FYI in Firefox 3.0.6 on my Mac it seems I can get at those values using the Java plugin with following bookmarklet: javascript:alert(java.awt.MouseInfo.getPointerInfo().getLocation ().getX()); by typing that in the URL bar I can get current mouse X coordinates. I cannot make it work

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread unwiredbrain
2009/2/27 d3r1v3d (Gavin Mulligan) vtga...@gmail.com: You're right, it does seem to work in IE 7. However, it still fails to work in Firefox and Chrome... Both methods suggested by Andrea Giammarchi are working properly on my box -- Firefox 3.0.6, Linux. I wonder if it's just a Windows'

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread d3r1v3d (Gavin Mulligan)
Just out of curiosity, Marcus, I would be interested to know why you want to know the user's mouse position before they move it. Maybe there's a better solution that'll fit snugly within the scope of your requirements. - Gavin On Feb 27, 12:02 pm, unwiredbrain unwiredbr...@gmail.com wrote:

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread Andrea Giammarchi
I bet is the classic banner, spot, or JS effect to attach to the mouse and somebody asked him why it is not attached since the beginning ... well, Marcus, if it is the case tell them that the browser is inside a window and if the user is not interacting with that window there's nothing you can do

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread d3r1v3d (Gavin Mulligan)
Hi Abel, I think it's more of a problem as to when the browsers update the appropriate DOM elements that determine the user's current mouse position (e.g. pageX / pageY and clientX / clientY). We can use jQuery (or really just POJS) to trigger code that runs when a document is loaded, but if

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-27 Thread Diego Perini
Andrea, On 28 Feb, 00:42, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I bet is the classic banner, spot, or JS effect to attach to the mouse and somebody asked him why it is not attached since the beginning ... well, Marcus, if it is the case tell them that the browser is inside a

[jquery-dev] Re: Is it possible to get mouse position when the page has loaded without moving the mouse?

2009-02-26 Thread d3r1v3d (Gavin Mulligan)
Hi Marcus, The function I've always used for obtaining the current mouse position is: function getMousePosition(eventObj){ if (eventObj.pageX eventObj.pageY) { return {x: eventObj.pageX, y: eventObj.pageY}; } return {x: (eventObj.clientX + document.body.scrollLeft -