Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Show/hide table

Reply
Thread Tools

Show/hide table

 
 
Mateo
Guest
Posts: n/a
 
      10-25-2005
Hi!

I have a litle JS problem.... I'm trying to make show/hide table JS
function, but my show/hide table
function works only on IE.... It works in mozilla partially. Actually,every
time when I contract table the empty
field is left.

You can see example in left side menu on www.kijevo.hr when you click on
plus or minus. If you
access page from mozilla you will se the problem... From IE it works just
fine...


For show/hide efect I used style.display = 'block'; and style.display =
'none';
(I didn't actually wrote function, I adapted it)

Here is code:
function showtrPV( row) {

var strTable = 'tblUslugaSH';

var strIMG = 'imgSH';

if (document.getElementById(strTable).rows[1].style.display == 'none') {

document.getElementById(strIMG).src = 'Pictures/minus.gif';

document.getElementById(strTable).rows[1].style.display = 'block';

eval("lblRoomTypeCrta" + nRedniBrojUsluge + ".style.visibility =
'hidden'" + ";");

}

else {

document.getElementById(strIMG).src = 'Pictures/plus.gif';

document.getElementById(strTable).rows[1].style.display = 'none';

eval("lblRoomTypeCrta" + nRedniBrojUsluge + ".style.visibility = ''"
+ ";");

}

}




Thanks!


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      10-25-2005
Mateo wrote:

> I have a litle JS problem.... I'm trying to make show/hide table JS
> function, but my show/hide table function works only on IE


As of CSS 2, table rows default to "display: table-row". If you set them to
"display: block" then they won't act like table rows any more.

Toggle the style.display property between "none" and "" instead of "none"
and "block".

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
 
Mateo
Guest
Posts: n/a
 
      10-26-2005
Thx man!

U solved my problem! U Rock!

Mateo P.

"David Dorward" <(E-Mail Removed)> wrote in message
news:djm252$ltf$1$(E-Mail Removed)...
> Mateo wrote:
>
> > I have a litle JS problem.... I'm trying to make show/hide table JS
> > function, but my show/hide table function works only on IE

>
> As of CSS 2, table rows default to "display: table-row". If you set them

to
> "display: block" then they won't act like table rows any more.
>
> Toggle the style.display property between "none" and "" instead of "none"
> and "block".
>
> --
> David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
> Home is where the ~/.bashrc is



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
exchange routes between global IP routing table and VRF routing table zher Cisco 2 11-04-2004 11:28 PM
Tying up Port Login table entries with Port Table Entries in CISCO SNMP John Ramsden Cisco 0 07-24-2004 04:03 PM
Difference between routing-table and forwarding-table Joachim Krais Cisco 2 11-23-2003 02:52 PM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments