JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 4th, 2001, 06:58 PM
scream scream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 456 scream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 7 m 3 sec
Reputation Power: 13
Send a message via ICQ to scream
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?

Reply With Quote
  #2  
Old February 5th, 2001, 01:17 PM
JohnB JohnB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: UK
Posts: 527 JohnB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
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.

Reply With Quote
  #3  
Old February 5th, 2001, 09:46 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
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/

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > dhtml layers

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap