Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Show/hide table (http://www.velocityreviews.com/forums/t920971-show-hide-table.html)

Mateo 10-25-2005 06:48 PM

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!



David Dorward 10-25-2005 07:52 PM

Re: Show/hide table
 
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

Mateo 10-26-2005 07:44 AM

Re: Show/hide table
 
Thx man!

U solved my problem! U Rock!

Mateo P.

"David Dorward" <dorward@yahoo.com> wrote in message
news:djm252$ltf$1$830fa79d@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





All times are GMT. The time now is 05:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.