Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
New Developer
lisssjk
Posts: 2
Registered: ‎05-01-2009

fixed toolbar for web page for Pearl

I'm developing a small web app using asp.net and javascript that has two web pages.  WebPage1 needs a fixed toolbar and webPage2 does not.  As you scroll WebPage1, the toolbar should stay fixed to the top of the client window.  I've got this working for IE and Safari (iPhone), but I'm having a hard time getting it to work on older Blackberrys (Ranger 8100 os ver. 4.5.0.110, Pearl os ver. 4.2.1.96).

 

I can get javascript to run in the onload event on these devices, but I cannot connect to any scroll or to the unload event.  Because I cannot connect to the scroll event, I tried using a timer and the setInterval function to run code to reposition the toolbar.  I can get javascript to run successfully with a timer or with the setInterval function.  Problem is, that javascript continues to run after I leave WebPage1 and go to WebPage2.  I went with using a timer to call the moveToolbar function, and at the end of the function, I interogate the window.location or the window.document.url and in every case, this returns the url of WebPage1, even after I go to WebPage2.  The javascript is defined within <script> ... </script> tags withing the body section of WebPage1.

 

Is there any way to connect to a scroll or unload event on the Blackberry (ver. 4.2 or 4.5)?

 

Is there any way to get a page to realize it is actually dead to make it's locally defined javascript code stop running?

 

thanks in advance

steven :smileyhappy:

Please use plain text.
Developer
jwargo
Posts: 394
Registered: ‎12-18-2008
My Carrier: AT&T

Re: fixed toolbar for web page for Pearl

Prior to BlackBerry Device SOftware 4.6, the JavaScript DOM was Read-Only - there isn't any way to manipulate the in-memory web page via JavaScript.  Beginning with 4.6, the DOM is full function and modifyable.
Please use plain text.
New Developer
lisssjk
Posts: 2
Registered: ‎05-01-2009

Re: fixed toolbar for web page for Pearl

Ouch!  That's what I was afraid of.  Thankx for the info.

Please use plain text.