DHTML Forum  

Go Back   DHTML Forum > dhtmlcentral.com > Crossbrowser DHTML
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17.01.2004, 20:20
SBee SBee is offline
Neuer Benutzer
 
Join Date: 17.01.2004
Location: USA
Posts: 1
Default

Hi

having a problem with cross browser div layer visibility. The following works like a dream in Explorer, but not Netscape. The secondary nav does not become visible when you mouse over the main nav. I have read about this and i realize that NN doesn't like 'visible' but prefers 'hide' and 'show' among other things.

is there an easy way to adapt the foloowing to make it work in NN as well? I am mostly concerned with NN5 and up as i know NN4 is another pandoras box of problems...
If there is an easy solution that would be great, it is worth $$ to me, so if you can accept paypal that will be easy...

here is a link:
www.dev-area.com/browser/

here are snippets of the code:

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

first level nav:

<div id="top1" style="position:absolute; top:22px; left:270px; z-index:1;">
<a class="nav" onMouseOver="closeAll(); changeDiv('divOne','visible'); return true;">[img]images/about_us.gif[/img]</a>
</div>

second level nav:

<div id="divOne" style="position:absolute; top:50; left:25; visibility:hidden;">

<a class="nav" href="why.html" Target="_top"
ONMOUSEOVER="changeImages('a_why', 'images/a_why2.gif'); return true;" ONMOUSEOUT="changeImages('a_why', 'images/a_why.gif'); return true;">
[img]images/a_why.gif[/img]</a>***

<a class="nav" href="news.html" Target="_top"
ONMOUSEOVER="changeImages('news', 'images/news2.gif'); return true;" ONMOUSEOUT="changeImages('news', 'images/news.gif'); return true;">
[img]images/news.gif[/img]</a>***

<a class="nav" href="jobs.html" Target="_top"
ONMOUSEOVER="changeImages('jobs', 'images/jobs2.gif'); return true;" ONMOUSEOUT="changeImages('jobs', 'images/jobs.gif'); return true;">
[img]images/jobs.gif[/img]</a>
</div>



the script:

var div_array = new Array("divOne", "divTwo", "divThree", "divFour", "divFive", "divSix");
function changeDiv(the_div, the_change)
{
if (document.all)
{
div_string = "window.document.all." + the_div + ".style";
} else if (document.layers) {
div_string = "window.document." + the_div;

}
the_div = eval(div_string);
the_div.visibility = the_change;
}

function closeAll()
{
for (var loop=0; loop < div_array.length; loop++)
{
changeDiv(div_array[loop], "hidden");
}
}


function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i:joe18g81z6]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
a_why2 = newImage("images/a_why2.gif");
news2 = newImage("images/news2.gif");
jobs2 = newImage("images/jobs2.gif");
friends2 = newImage("images/friends2.gif");
green2 = newImage("images/green2.gif");
manufacturing2 = newImage("images/manufacturing2.gif");
view_prod2 = newImage("images/view_prod2.gif");
view_app2 = newImage("images/view_app2.gif");
fabrics2 = newImage("images/fabrics2.gif");
finishes2 = newImage("images/finishes2.gif");
hardware2 = newImage("images/hardware2.gif");
preloadFlag = true;
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Forum Jump

All times are GMT +2. The time now is 14:26.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.