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
Developer
Posts: 24
Registered: ‎10-23-2008
My Device: Not Specified
Accepted Solution

Need help for hidding div tag in BB 4.6 browser

Am going to give the senario please help me out to solve this problem..

 

Am trying to hide multiple div tags by using javascript..i,e assume I have 5 div tags...if I click the 1st div tag 2,3,4,5 needs to hide and the hidden contents of 1st will be visible....and if I click 2 div tag 1,3,4,5 needs to hide and contents of 2nd will be visible and so on...

 



<table>
<tr><td>
      <div class="visibleRow" id="click1">
         display 1st contents.......                     
       <a name="click1" href="" onClick="javascript&colondisplay('click1');return false;">Overview</a>
       </div>
</td></tr>

 <tr><td>
    <div class="visibleRow" id="click2">
       dispaly 2 contents......
                 <a name="click2" href="" onClick="javascript&colondisplay('click2');return false;">Target audience</a>
         </div>
  </td></tr>
  </table>

 

Javascript

 function display(sec)
   {
    var pg1=document.getElementById("click1");
    var pg2=document.getElementById("click2");
   
    if(sec=="click1")
    {
          pg1.className='visibleRow';
        pg2.className='hiddenRow';
    }
     
    else if(sec=="click2")
    {
        pg1.className='hiddenRow';
        pg2.className='visibleRow';
    }
   }

 

 


.css

.hiddenRow {
 display: none;
 visiblity: hidden;
}

.visibleRow {
 display:;
 visibility: visible;
}


This is not working for 1st div tag but when I click 2nd div tag its woring fine

Any solutions ???

Guru I
Posts: 19,012
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Need help for hidding div tag in BB 4.6 browser

does your html page validate the W3 validator ? http://validator.w3.org/
does this work in a desktop browser ? use Firefox and open the "error console".

can you post a concrete example on the net so we can look for real your example ?



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Developer
Posts: 24
Registered: ‎10-23-2008
My Device: Not Specified

Re: Need help for hidding div tag in BB 4.6 browser

Yes it works fine in Firefox browser but its not working in BB browser... even I have enabled javascript support in the device..
Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: Need help for hidding div tag in BB 4.6 browser

Try using "display:block;" instead of "display:;" in the visibleRow CSS and replacing the "&colon" string in your onClick attributes with actual colons.
Developer
Posts: 24
Registered: ‎10-23-2008
My Device: Not Specified

Re: Need help for hidding div tag in BB 4.6 browser

[ Edited ]

Ya I tried that display:block; in CSS instead of display:; and the &colon was a mistake while pasting the code its ":" only... still not working.. Smiley Sad

 

 

Assume...

 

Nokia

Blackberry

 

are the two links if I click Nokia nothing happens but I want to hide Blackberry when I click Nokia and If I click Blackberry then Nokia is hiding properly so the 2nd link is working fine dont know what is wrong in 1st link.  Smiley Sad.

Message Edited by prax83 on 12-06-2008 09:39 PM
Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: Need help for hidding div tag in BB 4.6 browser

Sounds like you have a typo somewhere then. If you can put up a sample page somewhere that demonstrates this it would be much easier to debug.
Developer
Posts: 24
Registered: ‎10-23-2008
My Device: Not Specified

Re: Need help for hidding div tag in BB 4.6 browser

[ Edited ]

I have figured out the solution by myself Smiley Happy

Thanks everyone for the help

 

.CSS wont work if we place the div tag in two different <td> of the table so I kept everything in one <td> now its working fine...

 

I had a real tough time to solve this problem Smiley Wink

 

Message Edited by prax83 on 12-07-2008 11:58 PM
Guru I
Posts: 19,012
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Need help for hidding div tag in BB 4.6 browser

then it was a pure HTML problem. You can't nest HTML objects across one another.
http://validator.w3.org/ would have told you what the error was in just a few seconds.



The search box on top-right of this page is your true friend, and the public Knowledge Base too: