No replies
jayshao
Offline
newbie
Highland Park, NJ
Last seen: 15 years 35 weeks ago
Highland Park, NJ
Timezone: GMT-5
Joined: 2004-04-02
Posts: 1
Points: 0

Hi everyone.

I'm working on a page for a University web application. We have a help button that starts out styled with "display:none" and then we use a javascript function onload to change it from display:none to "display:block."

This works in Mozilla, and IE. When I try debugging it in Opera, the elements are getting set with display:block, but then opera is not rendering them onto the screen. My function looks like this:

function init(){
   if(getRef('helpBtn')) getRef('helpBtn').style.display="inline";
   if(getRef('help')) getRef('help').style.display="none";
   if(getRef('closeHelp')) getRef('closeHelp').style.display="inline";
}

The second call, where I use getRef('help').style.display="none" works as expected, hiding the help dialog. The first and third statements change the value of the objects (as shown on the JS Console) but do not repaint the object to screen.

Does anyone know what's going on and a workaround?

Any help would be appreciated.

P.S. getRef is just a function we wrote to address objects by id. It works in all browsers, and Opera is parsing it correctly because it changes property, it just doesn't refresh the screen.