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.

inside custom component

Web and WebWorks Development

Reply
New Member
Posts: 1
Registered: ‎04-20-2010
My Device: 8830
My Carrier: Verizon

Screen redraw of div hide/show

I'm trying to do a simple hide/show of a div on the BBerry 8830 browser version 4.5, that sort of works.  When I hide the div, it does not hide unless I force a redraw of its screen area by opening and closing the browser menu.  The same is true when showing the div again: push button to show div, , text in div is still hidden, open menu, close menu, text in div is now visible.  Is their a way to force a redraw of the browser window?  Page source included below.

 

<HTML>
<head>
<script language=javascript type='text/javascript'>
function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'hidden';
}
else { // IE 4
document.all.hideshow.style.visibility = 'hidden';
}
}
}

function showdiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'visible';
}
else { // IE 4
document.all.hideshow.style.visibility = 'visible';
}
}
}
</script>
</head>

<a href="javascript&colon;hidediv()">hide div</a>
<a href="javascript&colon;showdiv()">show div</a>

<div id="hideshow">
My content
</div>

</HTML>

Highlighted
Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Screen redraw of div hide/show

Hello

 

V 4.5 is not a dynamic browser, if you wanted to hide and show a div you would have to recall the page and redraw as you have found out.

 

anything > 4.6 is dynamic and allows this kind of functionality to work.

 

cheers

 

Andrew