469,306 Members | 2,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Show/hide table

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!
Oct 25 '05 #1
2 6746
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
Oct 25 '05 #2
Thx man!

U solved my problem! U Rock!

Mateo P.

"David Dorward" <do*****@yahoo.com> wrote in message
news:dj*******************@news.demon.co.uk...
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

Oct 26 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Michael Skind | last post: by
7 posts views Thread by Mad Scientist Jr | last post: by
10 posts views Thread by oLE | last post: by
2 posts views Thread by MOHSEN KASHANI | last post: by
11 posts views Thread by jimstruckster | last post: by
6 posts views Thread by michael941 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.