updwebmaster Posted December 11, 2007 Share Posted December 11, 2007 I have a third party script for my navbar. This is the script: // (C) 2001 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header. // Set Show to "yes" to show the menu on start-up. // Set Show to "no" to show the selector on start-up. Show ="yes"; // Set OffX in pixels to a negative number // somewhat larger than the width of the menu. var OffX = -300; // Set the PosX and PosY variables // to the location on the screen where the // menu should position (in pixels) when stopped. var PosX = 7; var PosY = 100; // Usually, use the settings shown; but you can // change the speed and the increment of motion // across the screen, below. var speed = 2; var increment = 2; var incrementNS4 = 5; // for slower NS4 browsers // do not edit below this line // =========================== var is_NS = navigator.appName=="Netscape"; var is_Ver = parseInt(navigator.appVersion); var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5; var is_NS5up = is_NS&&is_Ver>=5; var MenuX=OffX; var SelX=PosX; var sPosX=PosX; var sOffX=OffX; if (Show=="yes"){ sPosX=OffX; sOffX=PosX; MenuX=sOffX; SelX=sPosX; } if (is_NS4){ increment=incrementNS4; Lq="document.layers."; Sq=""; eval(Lq+'menuSelect'+Sq+'.left=sPosX'); eval(Lq+'menuShow'+Sq+'.left=sOffX'); eval(Lq+'menuSelect'+Sq+'.top=PosY'); eval(Lq+'menuShow'+Sq+'.top=PosY'); }else{ Lq="document.all."; Sq=".style"; document.getElementById('menuSelect').style.left=sPosX+"px"; document.getElementById('menuShow').style.left=sOffX+"px"; document.getElementById('menuSelect').style.top=PosY+"px"; document.getElementById('menuShow').style.top=PosY+"px"; } function moveOnMenu(){ if (MenuX<PosX){ MenuX=MenuX+increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOnMenu()',speed); } } function moveOffMenu(){ if (MenuX>OffX){ MenuX=MenuX-increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOffMenu()',speed); } } function moveOffSelector(){ if (SelX>OffX){ SelX=SelX-increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOffSelector()',speed); } } function moveOnSelector(){ if (SelX<PosX){ SelX=SelX+increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOnSelector()',speed); } } The problem is that when I change the Show variable to "no", the whole script stops working. Can anyone help? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 Do you have your full code or a link to the original script - I need to see what it is doing. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 Do you have your full code or a link to the original script - I need to see what it is doing. Here's the link: http://codelifter.com/main/javascript/amazingglidermenu.html Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 you may have accidentally erased some code or something; because I changed it to "no" and it worked fine: <!-- ============================================================ Script: Amazing Glide-In Menu Script Functions: When an icon is clicked, this script glides in a menu from screen-left. Clicking on the same icon in the menu causes it to slide off the screen, with the triggering icon sliding back in. The script can be set to have either the trigger icon or the menu show on start-up; and the menu and trigger icon positions can be set via script variables. An easy install, and a cool effect. Browsers: IE4-6,NS4-6 (some limited functionality in NS4) Author: etLux ============================================================ INSTRUCTIONS: This is another case where the script is actually fairly easy to install and set up, but the simplest way to present it is in a full-page working demo. Copy and paste this entire selection into a blank page. Follow the intructions commented into the script. ============================================================ //--> <html> <head> <!-- Put the <style> script in the <head> of your page. Set up the border, background-color, padding, and font elements as needed. Leave the position as is. Width and height can be set as auto, or you can specify these in pixels. //--> <style> #menuShow{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } #menuSelect{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } </style> </head> <body bgcolor="#000000"> <!-- Place the two <div>'s below in the <body> of your code. (Normally, this will be immediately after the <body> tag.) The menuShow div will contain your links; change the text, links, and targets as needed. //--> <div id="menuSelect"> <a href="#" onClick="moveOnMenu();moveOffSelector()"> <img src="icon.gif" width="28" height="28" border="0"></a> </div> <div id="menuShow"> <a href="#" onClick="moveOffMenu();moveOnSelector()"> <img src="icon.gif" width="28" height="28" border="0"></a> <br> <br> <a href="http://www.codelifter.com">Menu Item A</a><br> <a href="http://www.codelifter.com">Menu Item B</a><br> <a href="http://www.codelifter.com">Menu Item C</a><br> <br> <a href="http://www.codelifter.com">Menu Item D</a><br> <a href="http://www.codelifter.com">Menu Item E</a><br> <br> <a href="http://www.codelifter.com">Menu Item F</a><br> <a href="http://www.codelifter.com">Menu Item G</a><br> <a href="http://www.codelifter.com">Menu Item H</a><br> </div> <!-- Put the following script immediately *after* the <div>'s (above) in your page. Set the variables as indicated in the script. //--> <script> // (C) 2001 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header. // Set Show to "yes" to show the menu on start-up. // Set Show to "no" to show the selector on start-up. Show ="no"; // Set OffX in pixels to a negative number // somewhat larger than the width of the menu. var OffX = -150; // Set the PosX and PosY variables // to the location on the screen where the // menu should position (in pixels) when stopped. var PosX = 250; var PosY = 100; // Usually, use the settings shown; but you can // change the speed and the increment of motion // across the screen, below. var speed = 1; var increment = 1; var incrementNS4 = 5; // for slower NS4 browsers // do not edit below this line // =========================== var is_NS = navigator.appName=="Netscape"; var is_Ver = parseInt(navigator.appVersion); var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5; var is_NS5up = is_NS&&is_Ver>=5; var MenuX=OffX; var SelX=PosX; var sPosX=PosX; var sOffX=OffX; if (Show=="yes"){ sPosX=OffX; sOffX=PosX; MenuX=sOffX; SelX=sPosX; } if (is_NS4){ increment=incrementNS4; Lq="document.layers."; Sq=""; eval(Lq+'menuSelect'+Sq+'.left=sPosX'); eval(Lq+'menuShow'+Sq+'.left=sOffX'); eval(Lq+'menuSelect'+Sq+'.top=PosY'); eval(Lq+'menuShow'+Sq+'.top=PosY'); }else{ Lq="document.all."; Sq=".style"; document.getElementById('menuSelect').style.left=sPosX+"px"; document.getElementById('menuShow').style.left=sOffX+"px"; document.getElementById('menuSelect').style.top=PosY+"px"; document.getElementById('menuShow').style.top=PosY+"px"; } function moveOnMenu(){ if (MenuX<PosX){ MenuX=MenuX+increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOnMenu()',speed); } } function moveOffMenu(){ if (MenuX>OffX){ MenuX=MenuX-increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOffMenu()',speed); } } function moveOffSelector(){ if (SelX>OffX){ SelX=SelX-increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOffSelector()',speed); } } function moveOnSelector(){ if (SelX<PosX){ SelX=SelX+increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOnSelector()',speed); } } </script> </body> </html> <!-- ============================================================ //--> Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 the variables that I changed were the PosX, PosY, speed, increment, and OffX. Aside from Show. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 it still should work - try the code below - I altered all the variables that you said you altered and it still worked. <!-- ============================================================ Script: Amazing Glide-In Menu Script Functions: When an icon is clicked, this script glides in a menu from screen-left. Clicking on the same icon in the menu causes it to slide off the screen, with the triggering icon sliding back in. The script can be set to have either the trigger icon or the menu show on start-up; and the menu and trigger icon positions can be set via script variables. An easy install, and a cool effect. Browsers: IE4-6,NS4-6 (some limited functionality in NS4) Author: etLux ============================================================ INSTRUCTIONS: This is another case where the script is actually fairly easy to install and set up, but the simplest way to present it is in a full-page working demo. Copy and paste this entire selection into a blank page. Follow the intructions commented into the script. ============================================================ //--> <html> <head> <!-- Put the <style> script in the <head> of your page. Set up the border, background-color, padding, and font elements as needed. Leave the position as is. Width and height can be set as auto, or you can specify these in pixels. //--> <style> #menuShow{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } #menuSelect{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } </style> </head> <body bgcolor="#000000"> <!-- Place the two <div>'s below in the <body> of your code. (Normally, this will be immediately after the <body> tag.) The menuShow div will contain your links; change the text, links, and targets as needed. //--> <div id="menuSelect"> <a href="#" onClick="moveOnMenu();moveOffSelector()"> <img src="icon.gif" width="28" height="28" border="0"></a> </div> <div id="menuShow"> <a href="#" onClick="moveOffMenu();moveOnSelector()"> <img src="icon.gif" width="28" height="28" border="0"></a> <br> <br> <a href="http://www.codelifter.com">Menu Item A</a><br> <a href="http://www.codelifter.com">Menu Item B</a><br> <a href="http://www.codelifter.com">Menu Item C</a><br> <br> <a href="http://www.codelifter.com">Menu Item D</a><br> <a href="http://www.codelifter.com">Menu Item E</a><br> <br> <a href="http://www.codelifter.com">Menu Item F</a><br> <a href="http://www.codelifter.com">Menu Item G</a><br> <a href="http://www.codelifter.com">Menu Item H</a><br> </div> <!-- Put the following script immediately *after* the <div>'s (above) in your page. Set the variables as indicated in the script. //--> <script> // (C) 2001 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header. // Set Show to "yes" to show the menu on start-up. // Set Show to "no" to show the selector on start-up. Show ="no"; // Set OffX in pixels to a negative number // somewhat larger than the width of the menu. var OffX = -150; // phpQuestioner's Comments: This is how far the menu is off the left side of your page // Set the PosX and PosY variables // to the location on the screen where the // menu should position (in pixels) when stopped. var PosX = 100; var PosY = 50; // Usually, use the settings shown; but you can // change the speed and the increment of motion // across the screen, below. var speed = 8; var increment = 3; var incrementNS4 = 7; // for slower NS4 browsers // do not edit below this line // =========================== var is_NS = navigator.appName=="Netscape"; var is_Ver = parseInt(navigator.appVersion); var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5; var is_NS5up = is_NS&&is_Ver>=5; var MenuX=OffX; var SelX=PosX; var sPosX=PosX; var sOffX=OffX; if (Show=="yes"){ sPosX=OffX; sOffX=PosX; MenuX=sOffX; SelX=sPosX; } if (is_NS4){ increment=incrementNS4; Lq="document.layers."; Sq=""; eval(Lq+'menuSelect'+Sq+'.left=sPosX'); eval(Lq+'menuShow'+Sq+'.left=sOffX'); eval(Lq+'menuSelect'+Sq+'.top=PosY'); eval(Lq+'menuShow'+Sq+'.top=PosY'); }else{ Lq="document.all."; Sq=".style"; document.getElementById('menuSelect').style.left=sPosX+"px"; document.getElementById('menuShow').style.left=sOffX+"px"; document.getElementById('menuSelect').style.top=PosY+"px"; document.getElementById('menuShow').style.top=PosY+"px"; } function moveOnMenu(){ if (MenuX<PosX){ MenuX=MenuX+increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOnMenu()',speed); } } function moveOffMenu(){ if (MenuX>OffX){ MenuX=MenuX-increment; if (is_NS5up){ document.getElementById('menuShow').style.left=MenuX+"px"; }else{ eval(Lq+'menuShow'+Sq+'.left=MenuX'); } setTimeout('moveOffMenu()',speed); } } function moveOffSelector(){ if (SelX>OffX){ SelX=SelX-increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOffSelector()',speed); } } function moveOnSelector(){ if (SelX<PosX){ SelX=SelX+increment; if (is_NS5up){ document.getElementById('menuSelect').style.left=SelX+"px"; }else{ eval(Lq+'menuSelect'+Sq+'.left=SelX'); } setTimeout('moveOnSelector()',speed); } } </script> </body> </html> <!-- ============================================================ //--> Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 Visit my website and see: http://www.uberpilotdudes.com/home.htm . I currently have the Show variable to "no" Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 11, 2007 Share Posted December 11, 2007 ok - I got it to work - I think it was because the External JS was in the head and not in the body. your going to have to reposition the menu now - but hey; at least I got it working for you - right? <html> <HEAD><TITLE>[uPD] Home</TITLE> <META http-equiv=Content-Language content=en-us> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <LINK href="CSS/[uPD]%20Home.css" type=text/css rel=stylesheet> <link rel="shortcut icon" href="images/address.ico"> <link rel="icon" href="images/address_anim.gif" type="image/gif"> <STYLE type=text/css> .style1 { border-style: solid; border-width: 1px; text-align: center; } .style2 { border: 1px solid #ff0000; background-color: #000000; } .style4 { text-align: center; font-size: xx-large; } .style5 { text-align: left; } a { color: #FF0000; } a:visited { color: #000080; } a:active { color: #0000FF; } a:hover { color: #000080; } .style6 { text-align: center; } #menuShow{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } #menuSelect{ border: 1px solid #666666; background-color: #111111; padding: 13px; font-size: 13px; font-family: Verdana, Arial; position: absolute; width: auto; height: auto; } </STYLE> <META content="MSHTML 6.00.6000.16481" name=GENERATOR> <SCRIPT LANGUAGE="JavaScript" src="js/calendardate.js"> </script> </HEAD> <BODY style="BACKGROUND-IMAGE: url(images/star_wars_battlefront_2_913200514441pm902.jpg); COLOR: #ffffff"> <SCRIPT LANGUAGE="JavaScript" src="js/scrollstatus.js"> </SCRIPT> <div id="menuSelect"> <a href="javascript:void(0)" onClick="moveOnMenu();moveOffSelector()"><center> <img src="images/UPD%20symbol.jpg" width="26" height="26" border="0" /><font size="1pt"><br />navbar</font></center></a> </div> <div id="menuShow"> <a href="javascript:void(0)" onClick="moveOffMenu();moveOnSelector()"> <img src="images/UPD%20symbol.jpg" width="40" height="40" border="0" /><br />Click To hide this menu</a> <br /> <iframe src ="Navbar/Navbar.htm" style="width: 270px; height: 278px" id="Navbar" frameborder="0" scrolling="no"> </iframe> </div> <script type="text/javascript" src="js/menu.js"></script> <DIV id=masthead> <TABLE class=style2 style="WIDTH: 100%" align=center> <TBODY> <TR> <TD class=style4> <img src="images/UPD%20Banner%20edited.bmp" width="800" height="103"></TD></TR></TBODY></TABLE></DIV> <DIV class="style6"><br> <BR></DIV> <DIV> <TABLE class=style2 style="WIDTH: 100%" align=center> <TBODY> <TR> <TD class=style1 vAlign=top> <H3>Welcome to the [uPD] official web site!!</H3> <p>Todays news:</p> <p><script> document.write(dateMsg()); </script> </p> <P class=style5 align=center>This site is currently under construction.<FONT face=arial size=2> To learn more about our clan, go to the About Us page. If you want to join, we have a form that needs to be filled out and e-mailed to the clan leaders for reviewing. Have fun searching around and have a pleasant day! </FONT> </P> <P class=style5 align=center>If you are a member, please register for the member's area through me (bftwofreak). E-mail me at <a href="mailto:uberpilotdudes@yahoo.com"> uberpilotdudes@yahoo.com</a> with the subject member's area. Please place your swbf2 nickname and desired password in the message. Please give 12-24 hrs for login activation because I personally have to add you into the system. Don't forget to look at the ticker on the status bar of the webpages.</P> <P class=style6 align=center><a href="Calendar.php"> <IMG title="[uPD] Calendar" alt="[uPD] Calendar" src="images/calendar%20button.gif" border=0 width="110" height="35"></a> </P> </TD></TR></TBODY></TABLE></DIV> <DIV class=style5> <BR>This site was last updated on Saturday, October 6, 2007</DIV><!-- Start Bravenet.com Service Code --> <DIV align=center> </DIV><!-- End Bravenet.com Service Code --> </BODY> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.