JS calls different menu effects based on user browser type

Source: Internet
Author: User
Tags eval visibility

<script language= "JavaScript" >
<!--
var bv=parseint (navigator.appversion);
var ns4= (document.layers)? True:false;
var ie4= (document.all) && (bv>=4)? True:false;
var ver4 = (NS4 | | IE4)? True:false;

function ExpandIT () {return}
function ExpandAll () {return}
function nomsg () {self.status= "";}

if (ver4) {
isexpanded = false;

function GetIndex (EL) {
IND = NULL;
For (i=0 i<document.layers.length; i++) {
Whichel = Document.layers[i];
if (whichel.id = = EL) {
IND = i;
Break
}
}
return IND;
}

Function Arrange () {
   nexty = Document.layers[firstind].pagey + Document.layers[firstind]. Document.height;
   for (i=firstind+1 i<document.layers.length; i++) {
 whichel = document.layers[i];
& nbsp;   if (whichel.visibility!= "Hide") {
  whichel.pagey = nexty;
  nexty + = WHI ChEl.document.height;
   }
  }
}

function Initit () {
if (NS4) {
For (i=0 i<document.layers.length; i++) {
Whichel = Document.layers[i];
if (WhichEl.id.indexOf ("child")!=-1) whichel.visibility = "Hide";
}
Arrange ();
}
else {
Tempcoll = Document.all.tags ("DIV");
For (i=0 i<tempcoll.length; i++) {
if (Tempcoll (i). ClassName = = "Child") tempcoll (i) style.display = "None";
}
}
}

function ExpandIT (EL) {
if (!ver4) return;
if (IE4) {Expandie (EL)} else {Expandns (EL)}
}

function Expandie (EL) {
Whichel = eval (el + "Child");
Whichim = event.srcelement;

if (WhichEl.style.display = = "None") {
WhichEl.style.display = "block";
WHICHIM.SRC = "Bullet-minus.gif";
}
else {
WhichEl.style.display = "None";
WHICHIM.SRC = "Bullet-plus.gif";
}
}

function Expandns (EL) {
Whichel = eval ("document." + El + "Child");
Whichim = eval ("document." + El + "parent.document.images[' imEx ']");
if (whichel.visibility = = "Hide") {
Whichel.visibility = "show";
WHICHIM.SRC = "Bullet-minus.gif";
}
else {
Whichel.visibility = "Hide";
WHICHIM.SRC = "Bullet-plus.gif";
}
Arrange ();
}

function ShowAll () {
For (I=firstind i<document.layers.length; i++) {
Whichel = Document.layers[i];
Whichel.visibility = "show";
}
}

function ExpandAll (Isbot) {
NEWSRC = (isexpanded)? "Bullet-plus.gif": "Bullet-minus.gif";

if (NS4) {
document.images["imEx"].src = NEWSRC;
For (I=firstind i<document.layers.length; i++) {
Whichel = Document.layers[i];
if (WhichEl.id.indexOf ("Parent")!=-1) {
whichel.document.images["imEx"].src = NEWSRC;
}
if (WhichEl.id.indexOf ("child")!=-1) {
Whichel.visibility = (isexpanded)? "Hide": "Show";
}
}

Arrange ();
if (Isbot && isexpanded) Scrollto (0,document.layers[firstind].pagey);
}
else {
Divcoll = Document.all.tags ("DIV");
For (i=0 i<divcoll.length; i++) {
if (Divcoll (i). ClassName = = "Child") {
Divcoll (i). Style.display = (isexpanded)? "None": "Block";
}
}
Imcoll = Document.images.item ("imEx");
For (i=0 i<imcoll.length; i++) {
Imcoll (i). src = newsrc;
}
}

isexpanded =!isexpanded;
}

With (document) {
Write ("<style type= ' text/css ' >");
if (NS4) {
Write (". parent {Position:absolute; Visibility:hidden} ");
Write (". Child {Position:absolute; Visibility:hidden} ");
Write (". regular {Position:absolute; Visibility:hidden} ")
}
else {
Write (". Child {Display:none}")
}
Write ("</STYLE>");
}

onload = Initit;


}
-->
</SCRIPT>


<title> Quality Appreciation </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" href= ". /NAV/GX. CSS "Type=" Text/css >

<body bgcolor= "#FFFFFF" text= "#000000" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >
<table width= "778" border= "0" cellspacing= "0" cellpadding= "0" align= "center" >
<tr>
<td>
<!--#include file= ' title.asp '-->
</td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width= "770" align= "center" >
<tr>
&LT;TD valign=top width=619 height=0>
<table border= "0" cellspacing= "0" cellpadding= "0" align= "center" width= "100%" >
<tr>
&LT;TD colspan= "4" > Current position: Home &gt; design Decoration &gt;&gt; Decorative materials &gt;&gt;&gt; Furniture Products &gt;&gt;& Gt;&gt; Boutique Appreciation </td>
</tr>
<tr>
&LT;TD colspan= "4" >[<a href= "chantai.asp" > Dining table </a>]&nbsp; [<font color= "#FF0000" ><a href= "chaji.asp" > Coffee table </a></font>
]&nbsp;&nbsp; [<a href= "bed.asp" > Bed </a>]&nbsp;&nbsp; [<a href= "bed.asp" > Cabinet </a>
] [<a href= "shafa.asp" > Sofa </a><font color= "#FF0000" > </font>] [<font color= "#FF0000" > Office Furniture </font>
] [<a href= "cook.asp" > Kitchen furniture </a>]</td>
</tr>
<tr>
&LT;TD width= "25%" >
<div align= "center" ></div>
</td>
&LT;TD width= "25%" >
<div align= "center" ></div>
</td>
&LT;TD width= "25%" >
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
</tr>
<tr>
<td>
<div align= "center" >001</div>
</td>
<td>
<div align= "center" >002</div>
</td>
<td>
<div align= "center" >003</div>
</td>
<td>
<div align= "center" >004</div>
</td>
</tr>
<tr>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
</tr>
<tr>
<td>
<div align= "center" >005</div>
</td>
<td>
<div align= "center" >006</div>
</td>
<td>
<div align= "center" >007</div>
</td>
<td>
<div align= "center" >008</div>
</td>
</tr>
<tr>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
<td>
<div align= "center" ></div>
</td>
</tr>
<tr>
<td>
<div align= "center" >009</div>
</td>
<td>
<div align= "center" >010</div>
</td>
<td>
<div align= "center" >011</div>
</td>
<td>
<div align= "center" >012</div>
</td>
</tr>
</table>
</td>
&LT;TD align=middle rowspan=6 valign=top width=144>

</td>
</tr>
<tr>
&LT;TD valign=top> </td>
</tr>
</table>
<table width= "770" border= "0" cellspacing= "0" cellpadding= "0" align= "center" >
<tr>
<td>

</td>
</tr>
</table>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.