473,668 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Layers issue in Netscape 4.x - tabs question

Can anyone help me adjust this code so that it works in Netscape 4.x?

I have am developing a website for a restaurant and the menu page has
menus for lunch and dinner. Two images work as tabs, so that when you
click on the lunch menu, only that menu is visible, and likewise, when
you click on the dinner tab, only the dinner menu is visible.

This code works like a charm on IE 5.5, but I don't know how to get a
workable solution on Netscape. I suspect it's not so hard, but I need
a little help.

Thanks!!

*************** *************** ************
<script language="javas cript" type="text/javascript">
var tabVisible = "tab1"

function showTab(newTab) {
newButton="b"+n ewTab;
oldButton="b"+t abVisible.subst r(3);
show(oldButton, oldButton+".gif ");
show(newButton, newButton+"_ove r.gif");
newTab="tab"+ne wTab;
document.getEle mentById(tabVis ible).style.vis ibility = "hidden";
document.getEle mentById(newTab ).style.visibil ity = "visible";
tabVisible = newTab;
}

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

var preloadFlag = false;

function preloadImages() {if (document.image s) {
b1sel = newImage("image s/bt_menu_din.gif ");
b2sel = newImage("image s/bt_menu_lun.gif ");

b1off = newImage("image s/b1.gif");
preloadFlag = true;}}

function show(name,src)
{if (document.image s && (preloadFlag == true))
document.images[name].src = "images/" + src;}

</script>
Jul 23 '05 #1
3 1221
Lee
Jeannie said:

Can anyone help me adjust this code so that it works in Netscape 4.x?

I have am developing a website for a restaurant and the menu page has
menus for lunch and dinner. Two images work as tabs, so that when you
click on the lunch menu, only that menu is visible, and likewise, when
you click on the dinner tab, only the dinner menu is visible.

This code works like a charm on IE 5.5, but I don't know how to get a
workable solution on Netscape. I suspect it's not so hard, but I need
a little help.

Thanks!!

************** *************** *************
<script language="javas cript" type="text/javascript">
var tabVisible = "tab1"

function showTab(newTab) {
newButton="b"+ newTab;
oldButton="b"+ tabVisible.subs tr(3);
show(oldButton ,oldButton+".gi f");
show(newButton ,newButton+"_ov er.gif");
newTab="tab"+n ewTab;
document.getEl ementById(tabVi sible).style.vi sibility = "hidden";
document.getEl ementById(newTa b).style.visibi lity = "visible";
tabVisible = newTab;
}

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

var preloadFlag = false;

function preloadImages() {if (document.image s) {
b1sel = newImage("image s/bt_menu_din.gif ");
b2sel = newImage("image s/bt_menu_lun.gif ");

b1off = newImage("image s/b1.gif");
preloadFlag = true;}}

function show(name,src)
{if (document.image s && (preloadFlag == true))
document.image s[name].src = "images/" + src;}

</script>

The change to your Javascript code is to rewrite showTab()
as below. However, it still may not work, depending on
whether or not Netscape 4 sees not your page elements as
Layers.
function showTab(newTab) {
newButton="b"+n ewTab;
oldButton="b"+t abVisible.subst r(3);
show(oldButton, oldButton+".gif ");
show(newButton, newButton+"_ove r.gif");
newTab="tab"+ne wTab;
if(document.get ElementById){
document.getEle mentById(tabVis ible).style.vis ibility = "hidden";
document.getEle mentById(newTab ).style.visibil ity = "visible";
}else if(document.lay ers){
document.layers[tabVisible].visibility = "hidden";
document.layers[newTab].visibility = "visible";
}
tabVisible = newTab;
}

Jul 23 '05 #2
Thanks - I gave it a shot, but the menu tabs end up on the top of the
page, but the description of the menu items aren't visible. Not sure
what the fix would be, but thanks for your input!

Lee <RE************ **@cox.net> wrote in message news:<c5******* *@drn.newsguy.c om>...
Jeannie said:

Can anyone help me adjust this code so that it works in Netscape 4.x?

I have am developing a website for a restaurant and the menu page has
menus for lunch and dinner. Two images work as tabs, so that when you
click on the lunch menu, only that menu is visible, and likewise, when
you click on the dinner tab, only the dinner menu is visible.

This code works like a charm on IE 5.5, but I don't know how to get a
workable solution on Netscape. I suspect it's not so hard, but I need
a little help.

Thanks!!

************** *************** *************
<script language="javas cript" type="text/javascript">
var tabVisible = "tab1"

function showTab(newTab) {
newButton="b"+ newTab;
oldButton="b"+ tabVisible.subs tr(3);
show(oldButton ,oldButton+".gi f");
show(newButton ,newButton+"_ov er.gif");
newTab="tab"+n ewTab;
document.getEl ementById(tabVi sible).style.vi sibility = "hidden";
document.getEl ementById(newTa b).style.visibi lity = "visible";
tabVisible = newTab;
}

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

var preloadFlag = false;

function preloadImages() {if (document.image s) {
b1sel = newImage("image s/bt_menu_din.gif ");
b2sel = newImage("image s/bt_menu_lun.gif ");

b1off = newImage("image s/b1.gif");
preloadFlag = true;}}

function show(name,src)
{if (document.image s && (preloadFlag == true))
document.image s[name].src = "images/" + src;}

</script>

The change to your Javascript code is to rewrite showTab()
as below. However, it still may not work, depending on
whether or not Netscape 4 sees not your page elements as
Layers.
function showTab(newTab) {
newButton="b"+n ewTab;
oldButton="b"+t abVisible.subst r(3);
show(oldButton, oldButton+".gif ");
show(newButton, newButton+"_ove r.gif");
newTab="tab"+ne wTab;
if(document.get ElementById){
document.getEle mentById(tabVis ible).style.vis ibility = "hidden";
document.getEle mentById(newTab ).style.visibil ity = "visible";
}else if(document.lay ers){
document.layers[tabVisible].visibility = "hidden";
document.layers[newTab].visibility = "visible";
}
tabVisible = newTab;
}

Jul 23 '05 #3
I am still in need of a solution, so if anyone knows how to make this
tabbed script work for IE4+, NS4+, NS6+, please drop me a line.
Thanks!!

bi*******@aol.c om (Jeannie) wrote in message news:<51******* *************** ****@posting.go ogle.com>...
Thanks - I gave it a shot, but the menu tabs end up on the top of the
page, but the description of the menu items aren't visible. Not sure
what the fix would be, but thanks for your input!

Lee <RE************ **@cox.net> wrote in message news:<c5******* *@drn.newsguy.c om>...
Jeannie said:

Can anyone help me adjust this code so that it works in Netscape 4.x?

I have am developing a website for a restaurant and the menu page has
menus for lunch and dinner. Two images work as tabs, so that when you
click on the lunch menu, only that menu is visible, and likewise, when
you click on the dinner tab, only the dinner menu is visible.

This code works like a charm on IE 5.5, but I don't know how to get a
workable solution on Netscape. I suspect it's not so hard, but I need
a little help.

Thanks!!

************** *************** *************
<script language="javas cript" type="text/javascript">
var tabVisible = "tab1"

function showTab(newTab) {
newButton="b"+ newTab;
oldButton="b"+ tabVisible.subs tr(3);
show(oldButton ,oldButton+".gi f");
show(newButton ,newButton+"_ov er.gif");
newTab="tab"+n ewTab;
document.getEl ementById(tabVi sible).style.vi sibility = "hidden";
document.getEl ementById(newTa b).style.visibi lity = "visible";
tabVisible = newTab;
}

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

var preloadFlag = false;

function preloadImages() {if (document.image s) {
b1sel = newImage("image s/bt_menu_din.gif ");
b2sel = newImage("image s/bt_menu_lun.gif ");

b1off = newImage("image s/b1.gif");
preloadFlag = true;}}

function show(name,src)
{if (document.image s && (preloadFlag == true))
document.image s[name].src = "images/" + src;}

</script>

The change to your Javascript code is to rewrite showTab()
as below. However, it still may not work, depending on
whether or not Netscape 4 sees not your page elements as
Layers.
function showTab(newTab) {
newButton="b"+n ewTab;
oldButton="b"+t abVisible.subst r(3);
show(oldButton, oldButton+".gif ");
show(newButton, newButton+"_ove r.gif");
newTab="tab"+ne wTab;
if(document.get ElementById){
document.getEle mentById(tabVis ible).style.vis ibility = "hidden";
document.getEle mentById(newTab ).style.visibil ity = "visible";
}else if(document.lay ers){
document.layers[tabVisible].visibility = "hidden";
document.layers[newTab].visibility = "visible";
}

tabVisible = newTab;
}

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2805
by: Lizzy | last post by:
I have an internet application which has a progress bar show whenever the customer is requesting data from the server. This progress bar is coded to work in both Netscape 4.75 and above and IE 5.0 and above. The progress bar code is written in javascript in an external js file (progressbar.js). The web screen is in a seperate jsp file (Registration.jsp). The problem I'm having is that the progress bar is not showing in Netscape 4.75 on a...
1
1773
by: Chris Leonard | last post by:
Hi. Can anyone help me please. If the syntax for IE is: document.getElementById(layerID) What if I want to use layers ? document.layers ?????????
6
6835
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
2
12023
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references back to 0,0 on the entire page. If I set it to relative, the div layers will not overlap as needed. I prefer to avoid javascripting an 'innerHTML' re-write of a single div and would instead like to build two layers that can reside at the same...
3
3329
by: Crimefighter | last post by:
I'm not a javascript guy, but the use of this banner rotator script has given me fits. I know a few causes of the problem thus far, one being the layer tags aren't supported under Netscape 7.1 just the entire 4.X series. Script works fine under IE. I've tried a few things to get it working under Netscape, such as defining a style for the bannerLayer with the style tag, and trying to define the style under the div tag, I've tried the...
4
1448
by: PsychoCrow | last post by:
Hello everybody, I looked for my problem googling, but I found always similar answers about layer visualization. I expose my problem, I have tre layers: LAYER1 LAYER2 LAYER3 and I need to show/hide the layer I want, but in the way that the
10
54871
by: InvisibleMan | last post by:
Hi, Thanks for any help in advance... Okay, I have the JS listed below that calls for the display of the (DIV) tag... cookie function not included, as don't feel its necessary but you'll get the idea! function closeall() { var objs;
4
3793
by: ashkaan57 | last post by:
Hi, I am using the following code to show/hide part of an html page. It works in Netscape and Firefox but dies in IE: "Error: document.layers is null or not an object" <style> ..noshow { display: none; } ..menu {
2
2602
by: yawnmoth | last post by:
As I understand it, document.layers only works in Netscape 4+ (ie. it doesn't work in any version of Internet Explorer), while document.all only works in Internet Explorer 4+ (ie. it doesn't work in any version of Netscape). Is that correct? Also, what about document.getElementById? When did Internet Explorer start supporting that and when did Netscape start supporting that? I ask because I'm wondering how necessary doing something...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8367
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.