HighDots Forums  

show hide layer function

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss show hide layer function in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shortandfat webforumsuser@macromedia.com
 
Posts: n/a

Default show hide layer function - 07-09-2003 , 03:53 AM






When someone gets a url i want to show a layer

I like to show images , steak, tomatoe and shark

Now here is something i copied from devshed
and it ays its a function getur
how would i write this?

What would i write in the body script
I spent so much time trying to find out. This time i got the script and i am halfway there

No such thing as 'document.getLayerById'....unless you created a new method.

getURL ("javascript:vislayeron('myLayer')")???I don't understand this. Could someone write the entire script and script in the body that i need?short and fat.

function getElement(id) {
return document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) :
document.layers ? document.layers[id] : null;
}

function vislayeron(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = 'visible';
else if (el.visibility) el.visibility = 'show';
}

function vislayeroff(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = 'hidden';
else if (el.visibility) el.visibility = 'hide';
}


Last edited by mrrichardfeder on March 26th, 2002 at 07:44 PM

Report this post to a moderator | IP: Logged

March 26th, 2002 07:34 PM



degsy
Senior Member

Registered: Nov 2001
Location:
Posts: 657
oops, just a typo.

document.getLayerById('divname').style.visibility
should be
document.getElementById('divname').style.visibilit y



Report this post to a moderator | IP: Logged

March 26th, 2002 07:43 PM



CODE-Gobbler
Junior Member

Registered: Mar 2002
Location:
Posts: 27

quote:
--------------------------------------------------------------------------------
Originally posted by mrrichardfeder

getURL ("javascript:vislayeron('myLayer')");

--------------------------------------------------------------------------------



See






Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: show hide layer function - 07-09-2003 , 07:35 AM






Short:

Did you see my previous answer to this post from you?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"shortandfat" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
When someone gets a url i want to show a layer

I like to show images , steak, tomatoe and shark

Now here is something i copied from devshed
and it ays its a function getur
how would i write this?

What would i write in the body script
I spent so much time trying to find out. This time i got the script and i
am halfway there

No such thing as 'document.getLayerById'....unless you created a new
method.

getURL ("javascript:vislayeron('myLayer')")???I don't understand this.
Could someone write the entire script and script in the body that i
need?short and fat.
Quote:
function getElement(id) {
return document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) :
document.layers ? document.layers[id] : null;
}

function vislayeron(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = 'visible';
else if (el.visibility) el.visibility = 'show';
}

function vislayeroff(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = 'hidden';
else if (el.visibility) el.visibility = 'hide';
}


Last edited by mrrichardfeder on March 26th, 2002 at 07:44 PM

Report this post to a moderator | IP: Logged

March 26th, 2002 07:34 PM



degsy
Senior Member

Registered: Nov 2001
Location:
Posts: 657
oops, just a typo.

document.getLayerById('divname').style.visibility
should be
document.getElementById('divname').style.visibilit y



Report this post to a moderator | IP: Logged

March 26th, 2002 07:43 PM



CODE-Gobbler
Junior Member

Registered: Mar 2002
Location:
Posts: 27

quote:
--------------------------------------------------------------------------
------
Originally posted by mrrichardfeder

getURL ("javascript:vislayeron('myLayer')");

--------------------------------------------------------------------------
------



See








Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.