HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 April 22nd, 2000, 01:09 PM
$Brian $Brian is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 3 $Brian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm having a few problems with NS seeing that some of the layers that I have are actually objects.
I have show() and hide() that work, I just don't want to have onmouseover=15 hides
so, I tried to create an array that lists all of the layers. Then, a function hides all of those layers and shows only the ones that need be - here is the function:

function showSubNav(left,right) {
layername = new Array(layernames are here);
for(i= 0 ; i < 16 ; i++) {
hide(layername[i]);
}
show(left);
show(right);
}
my html code looks like this:
<a href="" onmouseover="showSubNav(layerleft,layerright);">

The layers exist and if my html code looked like this, it would work:

<a href="" onmouseover="show(layerleft); show(layerright); hide(hiddenlayer); hide(morehiddenlayers until done);">


But all that code is extrenious - the show()'s and hide()'s do work though.

So, basically, when I call the showSubNav() function, netscape then kicks back that the first element in the array list is not an object.
But, if I had done it out long hand, it would have worked, so therefore the object does exist.

Ok, I hope that I just made sense.

Thanx.

Reply With Quote
  #2  
Old April 23rd, 2000, 09:38 PM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 741 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
you just have to tell your hide script which div to hide - in the code below you need to set active as the div that is visible when the page opens - if you have no visible divs on the page opening make one that is empty and invisible because you need to set active to something.

Then your mouseover would be ="SL('nameofdiv')".... etc, then the div is made visible and active is set as the open layer which will get closed on the next SL('nameofdiv') call.

var active='div1';
function SL(id) {
if (document.all) { document.all[active].style.visibility = "hidden" } else {
document.layers[active].visibility = "hide"}
active=id;
if (document.all) { document.all[active].style.visibility = "visible" } else {
document.layers[active].visibility = "show"}
}

you can modify this code to open and close multiple divs quite easily, you just need to set a few more variables.

(and yes my browser sniffing looks a bit dodgy but only V4+ browsers ever get sent to this page)

Simon.

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #3  
Old April 25th, 2000, 06:11 PM
Argrajoca Argrajoca is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: SPAIN
Posts: 47 Argrajoca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
No very sure, but why don't try:

eval('hide('+layername[i]+')');

Hope it helps


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > convince NS that the layers are an object


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway