By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,833 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,833 IT Pros & Developers. It's quick & easy.

Show/hide table

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.