|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need a simple little snippet of DHTML and Javascript code. I've got an HTML table in <div> tags. I want to call a javascript function from the onclick event handler of a link that will set the visibility to false.
Can someone tell me how to do this? |
|
#2
|
|||
|
|||
|
function hideit(){
if (document.layers){ document.layers["mydivid"].visibility='hide'; } else { document.all["mydivid"].style.visibility='hidden'; } } <div ID="mydivid"> <TABLE> etc. </TABLE> </div> <A HREF="#" onClick="hideit();">Mylink</A> I think this works. |
|
#3
|
|||
|
|||
|
Almost. You left this out:
<div ID="mydivid" style="position:relative;"> Without the position: attribute, Nav4 won't create a Layer object, the only element you can set visibility on. Alternatively, use position:absolute. This may be in a style id, class, or inline as shown. Absolute positioning uses the next outermost positioned element (Layer in Nav4) for its 0,0 point (it may be the document itself); relative positioning offsets the Layer from its normal position in the flow of the document. Nested elements position relative to the positions of their parent element. Confused? http://www.webreference.com/html/tutorial18/ |
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > dhtml layers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|