eteran
asked on
Need help with this script.
I created this code with the exception of some help with the pros of this site. What I need is on each sub link no matter where the user presses, so long as on the same line it will link to the page on the word. Another feature I am trying to add to this is a feature in which the mouse moves out of the range it should hide the box. Just cut and paste this to your editor and run you will see what I am talking about. Thank you for your time.
<style type="text/css"> <!--
.submenuStyle {
position: absolute;
visibility: hidden;
}
.menuStyle {
visibility: visable;
}
.m
{
FONT-SIZE: 12;
COLOR: #444444;
FONT-FAMILY: Arial;
font style: BOLD;
TEXT-DECORATION: none
}
//--></style>
<script language="JavaScript"><!--
// How many pixels to adjust down:
var steps = 20;
// How many total items untill the table is splits:
var split = 10;
// How many pixels to adjust left:
var rsteps = 6;
// Try these for vertical menus:
// var steps = -6;
// How many total items untill the table is splits:
// var split = 200 ;
// How many pixels to adjust left:
// var rsteps = -74;
// Create new main array.
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax Center"],
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as p", "Edit Profile"],
["HTTP://SEF.MLXCHANGE.COM", "MLS", "HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create Contract"],
["Staffviewofficelisting.a sp", "Office Listings","staffaddofficel isting.asp ", "Add Office Listing"],
["staffaddtransaction.asp" ,"Add Transaction","staffviewact ive.asp?ID =Active", "Active Pipeline", "staffviewactive.asp?ID=Cl osed", "Closed Pipeline", "staffviewactive.asp?ID=Dr opped", "Dropped Pipeline", "StaffTransactionreport.as p", "Report"],
["popup:staffaddlead.html" , "Add Lead","staffleadviewer.asp ", "Office Leads", "StaffMyleadviewer.asp", "My Leads", "popup:Staffaddmylead.html ","Add My Lead"]]
//LIST ITEMS YOU WANT TO OPEN UP IN A NEW WINDOW HERE
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|" )+"|";
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>');
}
document.writeln ('<table border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r="";>')
if(menuitems[x][xx].match( "popup:"))
{
document.writeln ('<a href=# onclick=\'window.open("'+m enuitems[x ][xx].spli t("popup:" )[1]+'","" ,"width=53 0,height=4 60");retur n false;\' class=m>');
}
else
{
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf(' |'+menuite ms[x][xx+1 ]+'|')!=-1 ?' target=blank':'')+'>');
}
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td valign=top>')
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div> ');
}
}
generate_layers();
if (browser_type == "Netscape" && (browser_version >= 4) && navigator.platform.indexOf ("Mac") >= 0) { var steps = steps - 20 }
function getAnchorPosition(anchorna me) {
var useWindow = false;
var coordinates = new Object();
var x=0;
var y=0;
var w_gebi = false;
var w_css = false;
var w_layers = false;
if (document.getElementById) { w_gebi = true; }
else if (document.all) { w_css = true; }
else if (document.layers) { w_layers = true; }
if (w_gebi && document.all) {
x = AnchorPosition_getPageOffs etLeft(doc ument.all[ anchorname ]);
y = AnchorPosition_getPageOffs etTop(docu ment.all[a nchorname] );
}
else if (w_gebi) {
var o = document.getElementById(an chorname);
x = o.offsetLeft;
y = o.offsetTop;
}
else if (w_css) {
x = AnchorPosition_getPageOffs etLeft(doc ument.all[ anchorname ]);
y = AnchorPosition_getPageOffs etTop(docu ment.all[a nchorname] );
}
else if (w_layers) {
var found=0;
for (var i=0; i<document.anchors.length; i++) {
if (document.anchors[i].name == anchorname) {
found=1;
break;
}
}
if (found == 0) {
coordinates.x=0; coordinates.y=0; return coordinates;
}
x = document.anchors[i].x;
y = document.anchors[i].y;
}
else {
coordinates.x=0; coordinates.y=0; return coordinates;
}
coordinates.x = x;
coordinates.y = y;
return coordinates;
}
function AnchorPosition_getPageOffs etLeft (el) {
var ol = el.offsetLeft;
while ((el = el.offsetParent) != null) {
ol += el.offsetLeft;
}
return ol;
}
function AnchorPosition_getWindowOf fsetLeft (el) {
var scrollamount = document.body.scrollLeft;
return AnchorPosition_getPageOffs etLeft(el) -scrollamo unt;
}
function AnchorPosition_getPageOffs etTop (el) {
var ot = el.offsetTop;
while((el = el.offsetParent) != null) {
ot += el.offsetTop;
}
return ot;
}
function AnchorPosition_getWindowOf fsetTop (el) {
var scrollamount = document.body.scrollTop;
return AnchorPosition_getPageOffs etTop(el)- scrollamou nt;
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function show(object) {
var c = getAnchorPosition(object.r eplace(/su bmenu/, "menu"));
if (c.x < 1) { c.x = 31; }
if (c.y < 1) { c.y = 155; }
if (document.getElementById && document.getElementById(ob ject) != null) {
document.getElementById(ob ject).styl e.top=c.y + steps+"px";
document.getElementById(ob ject).styl e.left= c.x - rsteps+"px";
node = document.getElementById(ob ject).styl e.visibili ty='visibl e';
document.body.onclick= removeall;
}
else if (document.layers && document.layers[object] != null) {
document.layers[object].vi sibility = 'visible';
document.layers[object].to p = c.y + steps;
document.layers[object].le ft = c.x - rsteps;
document.captureEvents(Eve nt.MOUSEMO VE | Event.MOUSEDOWN);
document.onmousedown = removeall;
}
else if (document.all)
{
document.all[object].style .visibilit y = 'visible';
document.all[object].style .pixelTop = c.y + steps;
document.all[object].style .pixelLeft = c.x - rsteps;
document.body.onclick= removeall;
}
var id = object.replace(/submenu/, "");
for(i = 1; i <= menuitems.length; i++)
{
if (i != id) {
remove(i);
}
}
var c = null
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function remove(id) {
if (document.getElementById && document.getElementById('s ubmenu'+id ) != null) {
node = document.getElementById('s ubmenu'+id ).style.vi sibility=' hidden';
}
else if (document.layers && document.layers['submenu'+ id] != null) {
document.layers['submenu'+ id].visibi lity = 'hidden';
}
else if (document.all)
{
document.all['submenu'+id] .style.vis ibility = 'hidden';
}
}
//--></script>
<body bgcolor="#F4F8E1">
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<span align="center">
<td>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#000000" width="760" bgcolor="#89AE79">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<span align="center">
<td bordercolor="#89AE79">
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#89AE79" width="760">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="50%">
<img border="0" src="ima\logo1.jpg" width="171" height="73"> &n bsp; &nbs p; &n bsp; &nbs p;
<font face="Arial" size="2"> <b><span align="center"><span ID="linktext0"><a href= "staffmainpage.asp?"><font color="#000000">Home</font ></a></spa n></span>< /b></font> </td>
<td width="50%">
<span align="center">
<p align="center">
<b><font size="2" face="Arial" color="#444444">Welcome
to the CTVO<br>
</font>
<font face="Arial" color="#444444" style="font-size: 9pt">
CT's Virtual Office©</font></b></span>< /td>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="23">
<tr>
<td height="23">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="22">
<tr>
<td width="132" height="22"><b><font size="2" color="#444444"> <a onMouseOver="show('submenu 1')" class="m" id="menu1" name="menu1">
<font size="2">Message Center</font></a></font></ b></td>
<td width="124" height="22"><b><a onMouseOver="show('submenu 2')" class="m" id="menu2" name="menu2"><font size="2" color="#444444">Employee Center</font></a></b></td>
<td width="116" height="22"><b><a onMouseOver="show('submenu 3')" class="m" id="menu3" name="menu3"><font size="2" color="#444444">Realtor Tools</font></a></b></td>
<td width="87" height="22"><b><a onMouseOver="show('submenu 4')" class="m" id="menu4" name="menu4"><font size="2" color="#444444">Listings</ font></a>< /b></td>
<td width="166" height="22"><b><a onMouseOver="show('submenu 5')" class="m" id="menu5" name="menu5"><font size="2" color="#444444">Manage
Transactions</font></a></b ></td>
<td width="125" height="22"><b><a onMouseOver="show('submenu 6')" class="m" id="menu6" name="menu6"><font size="2" color="#444444">Lead Center</font></a></b></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse:col lapse;colo r=#444444; font-size= 12;font-fa mily=Arial ;font-weig ht=bold"
width="760" bgcolor="#BED9C4" bordercolor="#BED9C4" height="1">
<tr>
<span align="center">
<span ID="linktext">
<td width="630" height="16" align="left" bgcolor="#89AE79">
<p align="center">   ; &nb sp; & nbsp;  ; &nb sp; &n bsp; &n bsp; &n bsp; &n bsp; &n bsp;
<font color="#000000"> &nbs p; </font></td>
</span>
</span>
</tr>
</table>
<style type="text/css"> <!--
.submenuStyle {
position: absolute;
visibility: hidden;
}
.menuStyle {
visibility: visable;
}
.m
{
FONT-SIZE: 12;
COLOR: #444444;
FONT-FAMILY: Arial;
font style: BOLD;
TEXT-DECORATION: none
}
//--></style>
<script language="JavaScript"><!--
// How many pixels to adjust down:
var steps = 20;
// How many total items untill the table is splits:
var split = 10;
// How many pixels to adjust left:
var rsteps = 6;
// Try these for vertical menus:
// var steps = -6;
// How many total items untill the table is splits:
// var split = 200 ;
// How many pixels to adjust left:
// var rsteps = -74;
// Create new main array.
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as
["HTTP://SEF.MLXCHANGE.COM", "MLS", "HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create
["Staffviewofficelisting.a
["staffaddtransaction.asp"
["popup:staffaddlead.html"
//LIST ITEMS YOU WANT TO OPEN UP IN A NEW WINDOW HERE
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|"
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>');
}
document.writeln ('<table border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=this.style.bac
if(menuitems[x][xx].match(
{
document.writeln ('<a href=# onclick=\'window.open("'+m
}
else
{
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf('
}
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div>
}
}
generate_layers();
if (browser_type == "Netscape" && (browser_version >= 4) && navigator.platform.indexOf
function getAnchorPosition(anchorna
var useWindow = false;
var coordinates = new Object();
var x=0;
var y=0;
var w_gebi = false;
var w_css = false;
var w_layers = false;
if (document.getElementById) { w_gebi = true; }
else if (document.all) { w_css = true; }
else if (document.layers) { w_layers = true; }
if (w_gebi && document.all) {
x = AnchorPosition_getPageOffs
y = AnchorPosition_getPageOffs
}
else if (w_gebi) {
var o = document.getElementById(an
x = o.offsetLeft;
y = o.offsetTop;
}
else if (w_css) {
x = AnchorPosition_getPageOffs
y = AnchorPosition_getPageOffs
}
else if (w_layers) {
var found=0;
for (var i=0; i<document.anchors.length;
if (document.anchors[i].name == anchorname) {
found=1;
break;
}
}
if (found == 0) {
coordinates.x=0; coordinates.y=0; return coordinates;
}
x = document.anchors[i].x;
y = document.anchors[i].y;
}
else {
coordinates.x=0; coordinates.y=0; return coordinates;
}
coordinates.x = x;
coordinates.y = y;
return coordinates;
}
function AnchorPosition_getPageOffs
var ol = el.offsetLeft;
while ((el = el.offsetParent) != null) {
ol += el.offsetLeft;
}
return ol;
}
function AnchorPosition_getWindowOf
var scrollamount = document.body.scrollLeft;
return AnchorPosition_getPageOffs
}
function AnchorPosition_getPageOffs
var ot = el.offsetTop;
while((el = el.offsetParent) != null) {
ot += el.offsetTop;
}
return ot;
}
function AnchorPosition_getWindowOf
var scrollamount = document.body.scrollTop;
return AnchorPosition_getPageOffs
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function show(object) {
var c = getAnchorPosition(object.r
if (c.x < 1) { c.x = 31; }
if (c.y < 1) { c.y = 155; }
if (document.getElementById && document.getElementById(ob
document.getElementById(ob
document.getElementById(ob
node = document.getElementById(ob
document.body.onclick= removeall;
}
else if (document.layers && document.layers[object] != null) {
document.layers[object].vi
document.layers[object].to
document.layers[object].le
document.captureEvents(Eve
document.onmousedown = removeall;
}
else if (document.all)
{
document.all[object].style
document.all[object].style
document.all[object].style
document.body.onclick= removeall;
}
var id = object.replace(/submenu/, "");
for(i = 1; i <= menuitems.length; i++)
{
if (i != id) {
remove(i);
}
}
var c = null
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function remove(id) {
if (document.getElementById && document.getElementById('s
node = document.getElementById('s
}
else if (document.layers && document.layers['submenu'+
document.layers['submenu'+
}
else if (document.all)
{
document.all['submenu'+id]
}
}
//--></script>
<body bgcolor="#F4F8E1">
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<span align="center">
<td>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#000000" width="760" bgcolor="#89AE79">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<span align="center">
<td bordercolor="#89AE79">
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#89AE79" width="760">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="50%">
<img border="0" src="ima\logo1.jpg" width="171" height="73"> &n
<font face="Arial" size="2"> <b><span align="center"><span ID="linktext0"><a href= "staffmainpage.asp?"><font
<td width="50%">
<span align="center">
<p align="center">
<b><font size="2" face="Arial" color="#444444">Welcome
to the CTVO<br>
</font>
<font face="Arial" color="#444444" style="font-size: 9pt">
CT's Virtual Office©</font></b></span><
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="23">
<tr>
<td height="23">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="22">
<tr>
<td width="132" height="22"><b><font size="2" color="#444444"> <a onMouseOver="show('submenu
<font size="2">Message Center</font></a></font></
<td width="124" height="22"><b><a onMouseOver="show('submenu
<td width="116" height="22"><b><a onMouseOver="show('submenu
<td width="87" height="22"><b><a onMouseOver="show('submenu
<td width="166" height="22"><b><a onMouseOver="show('submenu
Transactions</font></a></b
<td width="125" height="22"><b><a onMouseOver="show('submenu
</tr>
</table>
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse:col
width="760" bgcolor="#BED9C4" bordercolor="#BED9C4" height="1">
<tr>
<span align="center">
<span ID="linktext">
<td width="630" height="16" align="left" bgcolor="#89AE79">
<p align="center">  
<font color="#000000"> &nbs
</span>
</span>
</tr>
</table>
ASKER
I did that and still not working.
Search this lines and take the new version:
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; ')
if(menuitems[x][xx].match( "popup:"))
{
document.writeln (' onclick=\'window.open("'+m enuitems[x ][xx].spli t("popup:" )[1]+'","" ,"width=53 0,height=4 60");retur n false;\' class=m ');
}
else
{
document.writeln (' onclick=\'window.location= "' + menuitems[x][xx] + '"\' ');
}
document.writeln ('>' + menuitems[x][xx+1] + '');
document.writeln ('</TD></TR></TABLE>');
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=this.style.bac
if(menuitems[x][xx].match(
{
document.writeln (' onclick=\'window.open("'+m
}
else
{
document.writeln (' onclick=\'window.location=
}
document.writeln ('>' + menuitems[x][xx+1] + '');
document.writeln ('</TD></TR></TABLE>');
ASKER
Zvonko,
I do not see what I replace
I do not see what I replace
Never mind.
Take the complette page:
<style type="text/css"> <!--
.submenuStyle {
position: absolute;
visibility: hidden;
}
.menuStyle {
visibility: visable;
}
.m
{
FONT-SIZE: 12;
COLOR: #444444;
FONT-FAMILY: Arial;
font style: BOLD;
TEXT-DECORATION: none
}
//--></style>
<script language="JavaScript"><!--
// How many pixels to adjust down:
var steps = 20;
// How many total items untill the table is splits:
var split = 10;
// How many pixels to adjust left:
var rsteps = 6;
// Try these for vertical menus:
// var steps = -6;
// How many total items untill the table is splits:
// var split = 200 ;
// How many pixels to adjust left:
// var rsteps = -74;
// Create new main array.
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax Center"],
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as p", "Edit Profile"],
["HTTP://SEF.MLXCHANGE.COM", "MLS", "HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create Contract"],
["Staffviewofficelisting.a sp", "Office Listings","staffaddofficel isting.asp ", "Add Office Listing"],
["staffaddtransaction.asp" ,"Add Transaction","staffviewact ive.asp?ID =Active", "Active Pipeline", "staffviewactive.asp?ID=Cl osed", "Closed Pipeline", "staffviewactive.asp?ID=Dr opped", "Dropped Pipeline", "StaffTransactionreport.as p", "Report"],
["popup:staffaddlead.html" , "Add Lead","staffleadviewer.asp ", "Office Leads", "StaffMyleadviewer.asp","M y Leads", "popup:Staffaddmylead.html ","Add My Lead"]]
//LIST ITEMS YOU WANT TO OPEN UP IN A NEW WINDOW HERE
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|" )+"|";
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>');
}
document.writeln ('<table border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=\'this.style.b ackgroundC olor="#89A E79";\' onMouseout=\'this.style.ba ckgroundCo lor="";\' class=m ')
if(menuitems[x][xx].match( "popup:"))
{
document.writeln (' onclick=\'window.open("'+m enuitems[x ][xx].spli t("popup:" )[1]+'","" ,"width=53 0,height=4 60");retur n false;\' ');
}
else
{
document.writeln (' onclick=\'window.location= "' + menuitems[x][xx] + '"\' ');
}
document.writeln ('>' + menuitems[x][xx+1] + '');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td valign=top>')
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div> ');
}
}
generate_layers();
if (browser_type == "Netscape" && (browser_version >= 4) && navigator.platform.indexOf ("Mac") >= 0) { var steps = steps - 20 }
function getAnchorPosition(anchorna me) {
var useWindow = false;
var coordinates = new Object();
var x=0;
var y=0;
var w_gebi = false;
var w_css = false;
var w_layers = false;
if (document.getElementById) { w_gebi = true; }
else if (document.all) { w_css = true; }
else if (document.layers) { w_layers = true; }
if (w_gebi && document.all) {
x = AnchorPosition_getPageOffs etLeft(doc ument.all[ anchorname ]);
y = AnchorPosition_getPageOffs etTop(docu ment.all[a nchorname] );
}
else if (w_gebi) {
var o = document.getElementById(an chorname);
x = o.offsetLeft;
y = o.offsetTop;
}
else if (w_css) {
x = AnchorPosition_getPageOffs etLeft(doc ument.all[ anchorname ]);
y = AnchorPosition_getPageOffs etTop(docu ment.all[a nchorname] );
}
else if (w_layers) {
var found=0;
for (var i=0; i<document.anchors.length; i++) {
if (document.anchors[i].name == anchorname) {
found=1;
break;
}
}
if (found == 0) {
coordinates.x=0; coordinates.y=0; return coordinates;
}
x = document.anchors[i].x;
y = document.anchors[i].y;
}
else {
coordinates.x=0; coordinates.y=0; return coordinates;
}
coordinates.x = x;
coordinates.y = y;
return coordinates;
}
function AnchorPosition_getPageOffs etLeft (el) {
var ol = el.offsetLeft;
while ((el = el.offsetParent) != null) {
ol += el.offsetLeft;
}
return ol;
}
function AnchorPosition_getWindowOf fsetLeft (el) {
var scrollamount = document.body.scrollLeft;
return AnchorPosition_getPageOffs etLeft(el) -scrollamo unt;
}
function AnchorPosition_getPageOffs etTop (el) {
var ot = el.offsetTop;
while((el = el.offsetParent) != null) {
ot += el.offsetTop;
}
return ot;
}
function AnchorPosition_getWindowOf fsetTop (el) {
var scrollamount = document.body.scrollTop;
return AnchorPosition_getPageOffs etTop(el)- scrollamou nt;
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function show(object) {
var c = getAnchorPosition(object.r eplace(/su bmenu/, "menu"));
if (c.x < 1) { c.x = 31; }
if (c.y < 1) { c.y = 155; }
if (document.getElementById && document.getElementById(ob ject) != null) {
document.getElementById(ob ject).styl e.top=c.y + steps+"px";
document.getElementById(ob ject).styl e.left= c.x - rsteps+"px";
node = document.getElementById(ob ject).styl e.visibili ty='visibl e';
document.body.onclick= removeall;
}
else if (document.layers && document.layers[object] != null) {
document.layers[object].vi sibility = 'visible';
document.layers[object].to p = c.y + steps;
document.layers[object].le ft = c.x - rsteps;
document.captureEvents(Eve nt.MOUSEMO VE | Event.MOUSEDOWN);
document.onmousedown = removeall;
}
else if (document.all)
{
document.all[object].style .visibilit y = 'visible';
document.all[object].style .pixelTop = c.y + steps;
document.all[object].style .pixelLeft = c.x - rsteps;
document.body.onclick= removeall;
}
var id = object.replace(/submenu/, "");
for(i = 1; i <= menuitems.length; i++)
{
if (i != id) {
remove(i);
}
}
var c = null
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function remove(id) {
if (document.getElementById && document.getElementById('s ubmenu'+id ) != null) {
node = document.getElementById('s ubmenu'+id ).style.vi sibility=' hidden';
}
else if (document.layers && document.layers['submenu'+ id] != null) {
document.layers['submenu'+ id].visibi lity = 'hidden';
}
else if (document.all)
{
document.all['submenu'+id] .style.vis ibility = 'hidden';
}
}
//--></script>
<body bgcolor="#F4F8E1">
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<span align="center">
<td>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#000000" width="760" bgcolor="#89AE79">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<span align="center">
<td bordercolor="#89AE79">
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#89AE79" width="760">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="50%">
<img border="0" src="ima\logo1.jpg" width="171" height="73"> &n bsp; &nbs p; &n bsp; &nbs p;
<font face="Arial" size="2"> <b><span align="center"><span ID="linktext0"><a href="staffmainpage.asp?"> <font color="#000000">Home</font ></a></spa n></span>< /b></font> </td>
<td width="50%">
<span align="center">
<p align="center">
<b><font size="2" face="Arial" color="#444444">Welcome
to the CTVO<br>
</font>
<font face="Arial" color="#444444" style="font-size: 9pt">
CT's Virtual Office©</font></b></span>< /td>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="23">
<tr>
<td height="23">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="22">
<tr>
<td width="132" height="22"><b><font size="2" color="#444444"> <a onMouseOver="show('submenu 1')" class="m" id="menu1" name="menu1">
<font size="2">Message Center</font></a></font></ b></td>
<td width="124" height="22"><b><a onMouseOver="show('submenu 2')" class="m" id="menu2" name="menu2"><font size="2" color="#444444">Employee Center</font></a></b></td>
<td width="116" height="22"><b><a onMouseOver="show('submenu 3')" class="m" id="menu3" name="menu3"><font size="2" color="#444444">Realtor Tools</font></a></b></td>
<td width="87" height="22"><b><a onMouseOver="show('submenu 4')" class="m" id="menu4" name="menu4"><font size="2" color="#444444">Listings</ font></a>< /b></td>
<td width="166" height="22"><b><a onMouseOver="show('submenu 5')" class="m" id="menu5" name="menu5"><font size="2" color="#444444">Manage
Transactions</font></a></b ></td>
<td width="125" height="22"><b><a onMouseOver="show('submenu 6')" class="m" id="menu6" name="menu6"><font size="2" color="#444444">Lead Center</font></a></b></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse:col lapse;colo r=#444444; font-size= 12;font-fa mily=Arial ;font-weig ht=bold"
width="760" bgcolor="#BED9C4" bordercolor="#BED9C4" height="1">
<tr>
<span align="center">
<span ID="linktext">
<td width="630" height="16" align="left" bgcolor="#89AE79">
<p align="center">   ; &nb sp; & nbsp;  ; &nb sp; &n bsp; &nbs p; &n bsp; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &n bsp;
<font color="#000000"> &nbs p; </font></td>
</span>
</span>
</tr>
</table>
Take the complette page:
<style type="text/css"> <!--
.submenuStyle {
position: absolute;
visibility: hidden;
}
.menuStyle {
visibility: visable;
}
.m
{
FONT-SIZE: 12;
COLOR: #444444;
FONT-FAMILY: Arial;
font style: BOLD;
TEXT-DECORATION: none
}
//--></style>
<script language="JavaScript"><!--
// How many pixels to adjust down:
var steps = 20;
// How many total items untill the table is splits:
var split = 10;
// How many pixels to adjust left:
var rsteps = 6;
// Try these for vertical menus:
// var steps = -6;
// How many total items untill the table is splits:
// var split = 200 ;
// How many pixels to adjust left:
// var rsteps = -74;
// Create new main array.
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as
["HTTP://SEF.MLXCHANGE.COM", "MLS", "HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create
["Staffviewofficelisting.a
["staffaddtransaction.asp"
["popup:staffaddlead.html"
//LIST ITEMS YOU WANT TO OPEN UP IN A NEW WINDOW HERE
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|"
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>');
}
document.writeln ('<table border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0><TR>')
document.writeln ('<TD style=width:100%; onMouseover=\'this.style.b
if(menuitems[x][xx].match(
{
document.writeln (' onclick=\'window.open("'+m
}
else
{
document.writeln (' onclick=\'window.location=
}
document.writeln ('>' + menuitems[x][xx+1] + '');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div>
}
}
generate_layers();
if (browser_type == "Netscape" && (browser_version >= 4) && navigator.platform.indexOf
function getAnchorPosition(anchorna
var useWindow = false;
var coordinates = new Object();
var x=0;
var y=0;
var w_gebi = false;
var w_css = false;
var w_layers = false;
if (document.getElementById) { w_gebi = true; }
else if (document.all) { w_css = true; }
else if (document.layers) { w_layers = true; }
if (w_gebi && document.all) {
x = AnchorPosition_getPageOffs
y = AnchorPosition_getPageOffs
}
else if (w_gebi) {
var o = document.getElementById(an
x = o.offsetLeft;
y = o.offsetTop;
}
else if (w_css) {
x = AnchorPosition_getPageOffs
y = AnchorPosition_getPageOffs
}
else if (w_layers) {
var found=0;
for (var i=0; i<document.anchors.length;
if (document.anchors[i].name == anchorname) {
found=1;
break;
}
}
if (found == 0) {
coordinates.x=0; coordinates.y=0; return coordinates;
}
x = document.anchors[i].x;
y = document.anchors[i].y;
}
else {
coordinates.x=0; coordinates.y=0; return coordinates;
}
coordinates.x = x;
coordinates.y = y;
return coordinates;
}
function AnchorPosition_getPageOffs
var ol = el.offsetLeft;
while ((el = el.offsetParent) != null) {
ol += el.offsetLeft;
}
return ol;
}
function AnchorPosition_getWindowOf
var scrollamount = document.body.scrollLeft;
return AnchorPosition_getPageOffs
}
function AnchorPosition_getPageOffs
var ot = el.offsetTop;
while((el = el.offsetParent) != null) {
ot += el.offsetTop;
}
return ot;
}
function AnchorPosition_getWindowOf
var scrollamount = document.body.scrollTop;
return AnchorPosition_getPageOffs
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function show(object) {
var c = getAnchorPosition(object.r
if (c.x < 1) { c.x = 31; }
if (c.y < 1) { c.y = 155; }
if (document.getElementById && document.getElementById(ob
document.getElementById(ob
document.getElementById(ob
node = document.getElementById(ob
document.body.onclick= removeall;
}
else if (document.layers && document.layers[object] != null) {
document.layers[object].vi
document.layers[object].to
document.layers[object].le
document.captureEvents(Eve
document.onmousedown = removeall;
}
else if (document.all)
{
document.all[object].style
document.all[object].style
document.all[object].style
document.body.onclick= removeall;
}
var id = object.replace(/submenu/, "");
for(i = 1; i <= menuitems.length; i++)
{
if (i != id) {
remove(i);
}
}
var c = null
}
function removeall() {
for(i = 1; i <= menuitems.length; i++) { remove(i); }
}
function remove(id) {
if (document.getElementById && document.getElementById('s
node = document.getElementById('s
}
else if (document.layers && document.layers['submenu'+
document.layers['submenu'+
}
else if (document.all)
{
document.all['submenu'+id]
}
}
//--></script>
<body bgcolor="#F4F8E1">
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<span align="center">
<td>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#000000" width="760" bgcolor="#89AE79">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<span align="center">
<td bordercolor="#89AE79">
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#89AE79" width="760">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="50%">
<img border="0" src="ima\logo1.jpg" width="171" height="73"> &n
<font face="Arial" size="2"> <b><span align="center"><span ID="linktext0"><a href="staffmainpage.asp?">
<td width="50%">
<span align="center">
<p align="center">
<b><font size="2" face="Arial" color="#444444">Welcome
to the CTVO<br>
</font>
<font face="Arial" color="#444444" style="font-size: 9pt">
CT's Virtual Office©</font></b></span><
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
</td></tr>
</table>
</td>
</span>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="23">
<tr>
<td height="23">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" id="AutoNumber1" height="22">
<tr>
<td width="132" height="22"><b><font size="2" color="#444444"> <a onMouseOver="show('submenu
<font size="2">Message Center</font></a></font></
<td width="124" height="22"><b><a onMouseOver="show('submenu
<td width="116" height="22"><b><a onMouseOver="show('submenu
<td width="87" height="22"><b><a onMouseOver="show('submenu
<td width="166" height="22"><b><a onMouseOver="show('submenu
Transactions</font></a></b
<td width="125" height="22"><b><a onMouseOver="show('submenu
</tr>
</table>
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse:col
width="760" bgcolor="#BED9C4" bordercolor="#BED9C4" height="1">
<tr>
<span align="center">
<span ID="linktext">
<td width="630" height="16" align="left" bgcolor="#89AE79">
<p align="center">  
<font color="#000000"> &nbs
</span>
</span>
</tr>
</table>
ASKER
the pop ups are not working
ASKER
that script that you posted is not wokring correctly can anyone help
eteran ,
the code that Zvonko provided is perfect, am able to get the popups in my browser.Did you cut and paste the page properly. Would be better if you posted your new page again so that we can see if there are any other errors.
the code that Zvonko provided is perfect, am able to get the popups in my browser.Did you cut and paste the page properly. Would be better if you posted your new page again so that we can see if there are any other errors.
ASKER
this links do not pop up
["HTTP://SEF.MLXCHANGE.COM", "MLS", "HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp",
Hi eteran...
I've changed this function a little so that if performs as you want...
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|" )+"|";
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>peter') ;
}
document.writeln ('<table onMouseOut=Check() border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0 onMouseOver=Check()><TR>')
//document.writeln ('<TD style=width:100%; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r="";>')
if(menuitems[x][xx].match( "popup:"))
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; onclick=window.open("'+men uitems[x][ xx].split( "popup:")[ 1]+'",""," width=530, height=460 ");return false;')
document.writeln('<span class=m>')
//document.writeln ('<a href=# onclick=\'window.open("'+m enuitems[x ][xx].spli t("popup:" )[1]+'","" ,"width=53 0,height=4 60");retur n false;\' class=m>');
}
else
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; onclick=window.location.hr ef="'+menu items[x][x x]+'";')
document.writeln('<span class=m>')
//document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf(' |'+menuite ms[x][xx+1 ]+'|')!=-1 ?' target=blank':'')+'>');
}
//document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln(menuitems [x][xx+1] + '</span><br>');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td valign=top>')
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div> ');
}
}
The following additions do the bit where it closes the menu once you move away from them...
function Check()
{
if(job)
{
clearTimeout(job)
job = 0
}
job = setTimeout("removeall()",1 000)
}
function SetTime()
{
job = setTimeout("removeall()",1 000)
}
you will also need to add this to the <body> tag.
onLoad="SetTime()"
I've tested and it seems to work fine. Where the 1000 is this is 1 second.
I've changed this function a little so that if performs as you want...
//Generate Span Layers
function generate_layers()
{
newWin="|"+newWin.join("|"
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>peter')
}
document.writeln ('<table onMouseOut=Check() border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0 onMouseOver=Check()><TR>')
//document.writeln ('<TD style=width:100%; onMouseover=this.style.bac
if(menuitems[x][xx].match(
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac
document.writeln('<span class=m>')
//document.writeln ('<a href=# onclick=\'window.open("'+m
}
else
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac
document.writeln('<span class=m>')
//document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf('
}
//document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln(menuitems
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div>
}
}
The following additions do the bit where it closes the menu once you move away from them...
function Check()
{
if(job)
{
clearTimeout(job)
job = 0
}
job = setTimeout("removeall()",1
}
function SetTime()
{
job = setTimeout("removeall()",1
}
you will also need to add this to the <body> tag.
onLoad="SetTime()"
I've tested and it seems to work fine. Where the 1000 is this is 1 second.
ASKER
?????????????????????????? ???/
I have tried to paste the code in the menu asnd it is not working
I have tried to paste the code in the menu asnd it is not working
Ok, I've put it online so you can see it working and then put the bits that I've changed in a <textarea> so you can copy it.
You need to replace the whole of the function generate_layers() with the one I supplied.
http://www.internection.co.uk/Source/eteran.htm
Cheers
McFly
You need to replace the whole of the function generate_layers() with the one I supplied.
http://www.internection.co.uk/Source/eteran.htm
Cheers
McFly
ASKER
OKay, I got it. can I make it disapear faster. and also there are links located that need to target in a new window
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
to change the quickness change the...
job = setTimeout("removeall()",1 000) <---- 1000 = 1 second
Ok, sorted the new window bit - I changed it a tiny bit coz I don't understand this bit - class=m'+(newWin.indexOf(' |'+menuite ms[x][xx+1 ]+'|')!=-1 ?' target=blank':'')+'>'); - but my modifications do work.
Ignore (remove - not needed now) this bit....
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
In this bit...
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax Center"],
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as p", "Edit Profile"],
["newwin:HTTP://SEF.MLXCHANGE.COM", "MLS", "newwin:HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create Contract"],
["Staffviewofficelisting.a sp", "Office Listings","staffaddofficel isting.asp ", "Add Office Listing"],
["staffaddtransaction.asp" ,"Add Transaction","staffviewact ive.asp?ID =Active", "Active Pipeline", "staffviewactive.asp?ID=Cl osed", "Closed Pipeline", "staffviewactive.asp?ID=Dr opped", "Dropped Pipeline", "StaffTransactionreport.as p", "Report"],
["popup:staffaddlead.html" , "Add Lead","staffleadviewer.asp ", "Office Leads", "StaffMyleadviewer.asp", "My Leads", "popup:Staffaddmylead.html ","Add My Lead"]]
...there is popup: - which is the popup windows, and then just normal pages, say staffemployeebook.asp for example.
I created a new one called newwin: - you can see in the menuitems I have prefixed HTTP://SEF.MLXCHANGE.COM with the new one I created - this is tested and works - hope thats ok.
I have posted the updates online (so you can test it if you like) but they are here below as well.....
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax Center"],
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as p", "Edit Profile"],
["newwin:HTTP://SEF.MLXCHANGE.COM", "MLS", "newwin:HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create Contract"],
["Staffviewofficelisting.a sp", "Office Listings","staffaddofficel isting.asp ", "Add Office Listing"],
["staffaddtransaction.asp" ,"Add Transaction","staffviewact ive.asp?ID =Active", "Active Pipeline", "staffviewactive.asp?ID=Cl osed", "Closed Pipeline", "staffviewactive.asp?ID=Dr opped", "Dropped Pipeline", "StaffTransactionreport.as p", "Report"],
["popup:staffaddlead.html" , "Add Lead","staffleadviewer.asp ", "Office Leads", "StaffMyleadviewer.asp", "My Leads", "popup:Staffaddmylead.html ","Add My Lead"]]
function generate_layers()
{
newWin="|"+newWin.join("|" )+"|";
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>peter') ;
}
document.writeln ('<table onMouseOut=Check() border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0 onMouseOver=Check()><TR>')
//document.writeln ('<TD style=width:100%; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r="";>')
if(menuitems[x][xx].match( "popup:"))
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; onclick=window.open("'+men uitems[x][ xx].split( "popup:")[ 1]+'",""," width=530, height=460 ");return false;')
document.writeln('<span class=m>')
//document.writeln ('<a href=# onclick=\'window.open("'+m enuitems[x ][xx].spli t("popup:" )[1]+'","" ,"width=53 0,height=4 60");retur n false;\' class=m>');
}
else if (menuitems[x][xx].match("n ewwin:"))
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; onclick=window.open("'+men uitems[x][ xx].split( "newwin:") [1]+'","", "");return false;')
document.writeln('<span class=m>')
}
else
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac kgroundCol or="#89AE7 9"; onMouseout=this.style.back groundColo r=""; onclick=window.location.hr ef="'+menu items[x][x x]+'";')
document.writeln('<span class=m>')
//document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf(' |'+menuite ms[x][xx+1 ]+'|')!=-1 ?' target=blank':'')+'>');
}
//document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln(menuitems [x][xx+1] + '</span><br>');
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td valign=top>')
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div> ');
}
}
job = setTimeout("removeall()",1
Ok, sorted the new window bit - I changed it a tiny bit coz I don't understand this bit - class=m'+(newWin.indexOf('
Ignore (remove - not needed now) this bit....
var newWin=new Array("HTTP://SEF.MLXCHANGE.COM","MLS","HTTP://MIAMIRE.COM", "Board of Realtors");
In this bit...
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as
["newwin:HTTP://SEF.MLXCHANGE.COM", "MLS", "newwin:HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create
["Staffviewofficelisting.a
["staffaddtransaction.asp"
["popup:staffaddlead.html"
...there is popup: - which is the popup windows, and then just normal pages, say staffemployeebook.asp for example.
I created a new one called newwin: - you can see in the menuitems I have prefixed HTTP://SEF.MLXCHANGE.COM with the new one I created - this is tested and works - hope thats ok.
I have posted the updates online (so you can test it if you like) but they are here below as well.....
var menuitems = [["popup:email_cdo.asp", "Add Message", "StaffEmail.asp", "View Email","faxlogin.asp","Fax
["staffemployeebook.asp", "Employee Phone Book","Staffeditprofile.as
["newwin:HTTP://SEF.MLXCHANGE.COM", "MLS", "newwin:HTTP://MIAMIRE.COM", "Board of Realtors", "StaffFinancial.asp", "Financial Calculator", "staffzipform.asp","Create
["Staffviewofficelisting.a
["staffaddtransaction.asp"
["popup:staffaddlead.html"
function generate_layers()
{
newWin="|"+newWin.join("|"
var x=0;
browser_type = navigator.appName;
for (x=0; x< menuitems.length; x++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle style="z-index:1;">');
}
else {
document.writeln ('<div id=submenu'+ (x+1) +' name=submenu'+ (x+1) +' class=submenuStyle>peter')
}
document.writeln ('<table onMouseOut=Check() border=1 bgcolor=#ffffff bordercolor=#89AE79 cellspacing=0 cellpadding=5><tr><td valign=top>')
var intmaxsplit = 50
if ((menuitems[x].length/5) > (split/2)) {
var intmaxsplit = (menuitems[x].length/2)
if (((intmaxsplit) % 2) == 0.5) {var intmaxsplit = intmaxsplit + 1;}
}
for (xx=0; xx< menuitems[x].length; xx++)
{
if (browser_type == "Microsoft Internet Explorer") {
document.writeln ('<TABLE width=114 border=0 cellspacing=0 cellpadding=0 onMouseOver=Check()><TR>')
//document.writeln ('<TD style=width:100%; onMouseover=this.style.bac
if(menuitems[x][xx].match(
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac
document.writeln('<span class=m>')
//document.writeln ('<a href=# onclick=\'window.open("'+m
}
else if (menuitems[x][xx].match("n
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac
document.writeln('<span class=m>')
}
else
{
document.writeln ('<TD style=width:100%; style="cursor: hand"; onMouseover=this.style.bac
document.writeln('<span class=m>')
//document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m'+(newWin.indexOf('
}
//document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
document.writeln(menuitems
document.writeln ('</TD></TR></TABLE>');
}
else {
document.writeln ('<a href = ' + menuitems[x][xx] + ' class=m >');
document.writeln ('' + menuitems[x][xx+1] + '</a><br>');
}
xx = xx +1
if ((xx) > intmaxsplit - 2) { document.writeln('</td><td
var intmaxsplit = 500
}
}
document.writeln ('<br>');
document.writeln ('</td></tr></table></div>
}
}
ASKER
I am getting an error??? I cut and paste the new code and the drop downs are not working.
What is the error?
ASKER
No pop ups
ASKER
on the mouse over. Anyway of pasting the working code so I can Compare the diffrence/.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You just need to put your <a href around the <tr or <td not just around the text.
Regards
Plucka