Jump to content
php.lv forumi

Sub menu Table


Gest3r

Recommended Posts

Tātad man ir skripts kura ir 2 mazi table un uzspiežot uz viena atveras viens teksts uzspiežot uz otra atveras cits teksts..

 

Bet problēma tāda ka viņi ir viens zem otra (tie abi table)

 

Vai kāds var pateikt kā viņus rindā uzlikt?

 

Mēģināju ņemt nost vajadzīgos <tr> </tr> , bet nekas nesanāca

 

Rekur skripts kurā ietilpst java script , css , un html(php)

 

 

<script type="text/javascript">

function change(id){

ID = document.getElementById(id);

 

if(ID.style.display == "")

ID.style.display = "none";

else

ID.style.display = "";

}

</script>

 

 

 

<style type="text/css">

BODY { text-align: center}

.tbl { FONT: NORMAL 11px/14px verdana, arial, sans-serif; border: 1px solid black; padding: 3px; Background: #F3F3F3; height: auto }

A {COLOR: #333333; TEXT-DECORATION: none; FONT-SIZE: 11px; font-weight: bold }

A:hover { COLOR: black; TEXT-DECORATION: none; FONT-SIZE: 11px; font-weight: bold}

</style>

[/color]

 

<body>

 

<table width="60">

<tr>

<td title="Show/Hide" onclick="change(1)" style="cursor: hand" onMouseOver="style.backgroundColor='#cecece';" onMouseOut="style.backgroundColor='#F3F3F3'" class="tbl" width="170" height="25">» <a onclick="change(1)" href="#">Posti</a></td>

</tr>

 

<!-- Sub menu 1 -->

<tr style="display: none" id="1">

<td class="tbl" width="170" height="25" style="background-color: #FFFFFF">

te teksts 1</td>

</tr>

 

<tr>

<td title="Show/Hide" onclick="change(2)" style="cursor: hand" onMouseOver="style.backgroundColor='#cecece';" onMouseOut="style.backgroundColor='#F3F3F3'" class="tbl" width="170" height="25">» <a onclick="change(2)" href="#">

Faili</a></td>

</tr>

 

<!-- Sub menu 2 -->

<tr style="display: none" id="2">

<td class="tbl" width="170" height="25" style="background-color: #FFFFFF">

te teksts 2</td>

</tr>

 

</table>

 

</body>

Edited by Gest3r
Link to comment
Share on other sites

×
×
  • Create New...