1
2
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
|
Gojan, did it work for you or not? I see that you're using a version of Windows 8, so it's important to know.
|
Your problem is that various IE versions don't use 'ScreenX' and 'ScreenY', they use 'screenLeft' and 'screenTop' instead.
See my Window Manager library's javascript for more details, the code that tracks window movement in that library uses screenLeft and screenTop to track coordinates. Also read http://www.w3schools.com/jsref/prop_win_screenx.asp I'm actually surprised it works at all as it is. |
Having had this discussion many, many, many times, no offense, but it it frustrating to continue to have to say. I am not using screenX and screenY; I am using the DOM event properties, screenX and screenY, which are supported by Internet Explorer.
In fact, the issue only seems to crop up in my script, though relentless testing by Bandock hasn't revealed why. He pasted the test snippet from W3Schools into BYOND and it worked fine. The last I talked to him, he mentioned something about the button "disappearing" at some point. I am currently testing it myself, actually and I'll probably report back in the other thread. |
Are you making sure that the event is passed to the hooked function? Some browser models don't support passing the event to the function as an argument, but rather, window.event holds the most recent event to bubble up through the javascript stack.
|
After doing some research, it appears that making a click call to a button fails to properly acquire 'event.screenX' and 'event.screenY'. Don't know if Windows 8 completely changed it for IE, but it appears that you now need a physical click at present to get any result.
I'll try to find a way to make it work without needing to make a physical click. Edit: I have now found out that it also fails under Firefox through some test code (borrowed from an example at W3Schools and tweaked it to match the situation). Here is some HTML code and try it at W3Schools or through another test environment. If anyone is able to return all screenX and screenY without any zeroes (Do not count the first time), announce what OS you use. <html> |
Actually Bandock, Internet Explorer was the only browser, if I'm not mistaken, that actually passed the coordinates of the mouse through the simulated click. Windows 8 shouldn't have been able to make a change to Internet Explorer when it runs in compatibility mode.
Anyway, I've determined that it isn't a Windows 8 issue either, much to my frustration. Gojan and I did some testing earlier with his Windows 8 machine and everything checked out. I even copied the script from the library (modified to output to the button instead of BYOND) into W3Schools' Javascript tester and he used Join.Me to show it working. At any rate, it seems that in all cases, event.clientX and event.clientY are returning properly, so I may just transition over to using those and use some math to find the absolute position on the screen. |
1
2
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)