473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 6984
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Michael Skind | last post by:
Hello, I use a simple Table : <TABLE> <TR 1> <TD></TD> </TR> <TR 2> <TD></TD> </TR>
7
by: Mad Scientist Jr | last post by:
Through messing around I got IE6 (win xp) to show/hide a table row. I gave my <TR> an ID of "trRow" and trRow.style.display='none'; hides it trRow.style.display='block'; displays it (will any...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
11
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
6
by: michael941 | last post by:
Hi, I have 2 tables in an html page. I have div them separately and id them as id1 and id2. I have a link there. What I need is click the link to hide one table and show the other and verse when...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
18
by: Liquidtouch | last post by:
I have been searching on this for awhile and cant find anything and playing around with it got me no where. I will start with what I am after and then explain what I have. I have a table with 3...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.