11-22-2009 12:26 PM
Hi all, just got a 9700 and love it. Best 'berry ever.
I'm trying to port a web page that tracks your position within a lengthy page. With OS 4.x the workaround I found was to place small form buttons here and there, and when the button came into view the HTML onFocus event would fire, and I'd know the browser was at position 'a', 'b', or whatnot.
OnFocus isn't working for any HTML element I try in OS 5. (I have OS 5.0.0.330, trying this in the Internet Browser.) I've tried onFocus on input buttons, IMG, A. Nothing happens -- event never fires. (I also tried onKeyPress and onKeyDown on BODY but that never fires either.)
Basically trying to track a position within the page, to know if we've arrived at point A, point B, C, etc. (Which is then saved as a cookie so on returning to the page we're popped back to the last known position. Essentially an in-page bookmark.)
Any thoughts on either why onFocus isn't firing, or alternative suggestions how to detect position within a lengthy page in OS 5?
Thanks.
11-22-2009 01:15 PM
You can try window.scrollY and see if that works.
11-22-2009 11:15 PM
Hmm, that might work. I've already got a regular timeout set on the page so every time it fires I could save out the current scrollY. I'll play with that.
(Still open to onFocus / onKeypress ideas...)