JavaScript - Help Making Numbers Counternshow Double Digits Like.. 00/00
I am using a great js gallery script from ....http://coffeescripter.com/code/ad-gallery/
they have a counter for the number of images shown, the number changes as user clicks on next bottom. from looking at the script, the counter is anchor to .ad-info and the counter code from the JS is ..... _afterShow: function() { this.gallery_info.html((this.current_index + 1) + ' / '+ this.images.length); if(!this.settings.cycle) { Can anyone help make the number show double digits only for the numbers 1,2,3,4,5,6,7,8,9 (example- 03/07 or 09/28 or 03/58).. etc..etc thanks for looking. Similar TutorialsI am working on my personal portfolio site, and am using a code that will make each portfolio piece appear in a new div when the name of the piece is clicked on. The problem is, JS does not seem to recognize double digits. I am not familiar with JS at all, I just got comfortable with CSS/HTML a few weeks ago! I am in over my head. It would really, really help if someone could show me how to change the code so that I could make about 15 to 20 divs instead of 9. Here is the code: Code: <script language="JavaScript"> numdivs=9 IE5=NN4=NN6=false if(document.all)IE5=true else if(document.layers)NN4=true else if(document.getElementById)NN6=true function init() { showDiv(0) } function showDiv( which ) { for(i=0;i<numdivs;i++) { if(NN4) eval("document.div"+i+".visibility='hidden'") if(IE5) eval("document.all.div"+i+".style.visibility='hidden'") if(NN6) eval("document.getElementById('div"+i+"').style.visibility='hidden'") } if(NN4) eval("document.div"+which+".visibility='visible'") if(IE5) eval("document.all.div"+which+".style.visibility='visible'") if(NN6) eval("document.getElementById('div"+which+"').style.visibility='visible'") } </script> Thank you for taking the time to read this! Hopefully someone can help. Hello, I am a hobbyist coder making a basic website for a friend, and I have a small problem. On an image slideshow, there is a counter at the bottom showing what image it is up to (ie 7/15), I'm not entirely sure how to change this into double digits (ie 07/15) I've found this thread (http://www.codingforums.com/showthread.php?t=212321) but am unsure how to integrate it into the slideshow I'm using, which is a different one. Here is the part from my JS I think that needs modifying: Code: if (setting.displaymode.type=="manual" && !setting.displaymode.wraparound){ this.paginatecontrol() } if (setting.$status) //if status container defined setting.$status.html(setting.curimage+1 + " / " + totalimages) Is this the right bit of code? If more of the code is needed to solve this please let me know. Any help is greatly appreciated! So far I've logged forty hours in total trying to locate and fix the major problems in this code. I've worked with two other forums and a pay-by-minute guru to no avail. I am hopeful that the good folks here at CodingForums will be able to take this code the final distance. I'll try to be verbose without boring anyone. Summary: This code was written in 2005/2007 by "Wonder" at ProBoards. I teach a fourth grade game design and applied mathematics class to home-schoolers on a ProBoards forum. It is placed in the global footer of the forum to allow forum members to roll dice in their posts. The code was incomplete. I worked with "Jordan" at ProBoards to fix the parts that were incomplete. A problem with the code resulted. Primary resolution I'm seeking: Right now the code does everything I could possibly want. However, it is mistakenly reading double-digit numbers (XY) as X = sides of die and Y = a negative modifier. Once this issue is fixed, I can take the roller back to my students and they can game together. Secondary resolutions I'm seeking: (1) I've been told twice that the code should be "tabbed out." Not sure what that means but I guess it makes it less messy. (2) When clicking the "Add Tag" button the code generates, it automatically inserts [dice=6] into a forum post. Would love this to simply be [dice=X] The original code from "Wonder": Code: <style type="text/css"> .dicebg {background-color: FFFFFF;border:solid 2px #000000;} .dicefont {background-color: FFFFFF;color: 000000; font-weight:bold;} </style> <script> //Dice Rolls In Posts v1.1 updated 31 October 2008 //Copyright 4-23-2007 ~Wonder //May be reposted anywhere as long as this header remains in tact //Do you want the dice to line of horizontally(true) or vertically(false) diceAlignment=true; //Enter URL of the image you want to appear as the dice ubbc button UBBCdiceImage="http://img100.imageshack.us/img100/6118/diceicon9rx.gif"; //Enter the default # of sides defaultSides=6; //Enable dice in preview? true or false enablePreview=true; rs="";mainForm=""; if(document.postForm) { mainForm=document.postForm; if(location.href.match(/action\=modifypost/)){enablePreview=true;} mainForm.color.parentNode.innerHTML+="<a href=javascript:add(\"[dice="+defaultSides+"]\",\"\")><img src=\""+UBBCdiceImage+"\" alt=\"Insert Dice Roll\" border=\"0\"></a>"; mainForm.onsubmit=addRand; mainForm.message.value=mainForm.message.value.replace(/(\[rand\=\d+\])/ig,""); rs=RegExp.$1; rs=(/\[rand\=/.test(rs))?rs:""; if(location.href.match(/quote\=\d+/)) { mainForm.message.value=mainForm.message.value.replace(/(\[dice\=\d+\])/ig,""); rs=""; } } else if(location.href.match(/action\=display/)) { ta=document.getElementsByTagName("textarea"); if(ta.length>0 && ta[0].name=="message") { mainForm=ta[0].parentNode; mainForm.onsubmit=addRand; } } /////////////////////// if(location.href.match(/action\=(display|pmview|recent|userrecentposts|gotopost|search|calendarview)/) || (!location.href.match(/action\=/) && document.postForm && enablePreview)) { hr=document.getElementsByTagName("hr"); for(i=0;i<hr.length;i++) { if(typeof(hr[i].parentNode)!="undefined" && hr[i].parentNode.tagName=="TD" && typeof(hr[i].parentNode.lastChild)!="undefined" && typeof(hr[i].parentNode.lastChild.lastChild)!="undefined" && hr[i].parentNode.lastChild.lastChild.nodeType!=1) { n=hr[i].parentNode.lastChild; rand=n.innerHTML.match(/\[rand\=\d+\]/); if(rand!=null) { n.innerHTML=n.innerHTML.replace(rand[0],""); rand=rand[0].replace(/[^\d]/g,""); dice=n.innerHTML.match(/\[dice\=\d+(\+\d+)?\]/ig); if(dice!=null) { for(k=0;k<dice.length;k++) { numb=dice[k].match(/\d+(\+\d+)?/); numb=numb[0].split("+"); addon=numb.length>1?parseInt(numb[1],10):0; numb=parseInt(numb[0],10); roll=Math.round((parseFloat(rand.substring(k,k+2)+"."+rand.substring(k+2,rand.length))/100)*(numb-1))+1+addon; n.innerHTML=n.innerHTML.replace(dice[k],"<table "+(diceAlignment?"style=\"display:inline\"":"")+" border=0 cellpadding=0 cellspacing=0><tr><td><table class=dicebg cellpadding=1 cellspacing=0><tr><td><center><font class=dicefont size=\"+1\"><b>"+roll+"</b><br><font size=\"1\">"+numb+" sides"+(addon>0?"+"+addon:"")+"</font></font></center></td></tr></table></td></tr></table> "); } } } } } } function addRand() { mainForm.message.value=mainForm.message.value.replace(/(\[rand\=\d+\])/ig,""); if((rs.length==0 && mainForm.message.value.match(/(\[dice\=\d+(\+\d+)?\])/)) && (enablePreview==true || (enablePreview==false && mainForm.nextaction.value=="post"))) { mainForm.message.value+="[rand="+(Math.random()+"").replace(/0\./,"")+(Math.random()+"").replace(/0\./,"")+(Math.random()+"").replace(/0\./,"")+( Math.random()+"").replace(/0\./,"")+"]"; } else { mainForm.message.value+=rs; } disable(mainForm); } </script> The altered code from "Jordan": Code: <style type="text/css"> .dicebg {background-color: FFFFFF;border:solid 2px #000000;} .dicefont {background-color: FFFFFF;color: 000000; font-weight:bold;} </style> <script> //Dice Rolls In Posts v1.1 updated by Jordan October 2009 //Copyright 4-23-2007 ~Wonder //May be reposted anywhere as long as this header remains in tact //Do you want the dice to line of horizontally(true) or vertically(false) diceAlignment=true; //Enter URL of the image you want to appear as the dice ubbc button UBBCdiceImage="http://img100.imageshack.us/img100/6118/diceicon9rx.gif"; //Enter the default # of sides defaultSides=6; //Enable dice in preview? true or false enablePreview=true; rs="";mainForm=""; if(document.postForm) { mainForm=document.postForm; if(location.href.match(/action\=modifypost/)){enablePreview=true;} mainForm.color.parentNode.innerHTML+="<a href=javascript:add(\"[dice="+defaultSides+"]\",\"\")><img src=\""+UBBCdiceImage+"\" alt=\"Insert Dice Roll\" border=\"0\"></a>"; mainForm.onsubmit=addRand; mainForm.message.value=mainForm.message.value.replace(/(\[rand\=\d+\])/ig,""); rs=RegExp.$1; rs=(/\[rand\=/.test(rs))?rs:""; if(location.href.match(/quote\=\d+/)) { mainForm.message.value=mainForm.message.value.replace(/(\[dice\=\d+\])/ig,""); rs=""; } } else if(location.href.match(/action\=display/)) { ta=document.getElementsByTagName("textarea"); if(ta.length>0 && ta[0].name=="message") { mainForm=ta[0].parentNode; mainForm.onsubmit=addRand; } } /////////////////////// if(location.href.match(/action\=(display|pmview|recent|userrecentposts|gotopost|search|calendarview)/) || (!location.href.match(/action\=/) && document.postForm && enablePreview)) { hr=document.getElementsByTagName("hr"); for(i=0;i<hr.length;i++) { if(typeof(hr[i].parentNode)!="undefined" && hr[i].parentNode.tagName=="TD" && typeof(hr[i].parentNode.lastChild)!="undefined" && typeof(hr[i].parentNode.lastChild.lastChild)!="undefined" && hr[i].parentNode.lastChild.lastChild.nodeType!=1) { n=hr[i].parentNode.lastChild; rand=n.innerHTML.match(/\[rand\=\d+\]/); if(rand!=null) { n.innerHTML=n.innerHTML.replace(rand[0],""); rand=rand[0].replace(/[^\d]/g,""); dice=n.innerHTML.match(/\[dice\=\d+((\+|\-)\d+)?\]/ig); if(dice!=null) { for(k=0;k<dice.length;k++) { numb=dice[k].match(/\d+((\+|\-)\d+)?/); numb=numb[0].split(RegExp.$2); unsigned = (RegExp.$2 == "+") ? true : false; addon=numb.length>1?parseInt(numb[1],10):0; if(!unsigned)addon = addon - addon * 2; numb=parseInt(numb[0],10); roll=Math.round((parseFloat(rand.substring(k,k+2)+"."+rand.substring(k+2,rand.length))/100)*(numb-1))+1+addon; n.innerHTML=n.innerHTML.replace(dice[k],"<table "+(diceAlignment?"style=\"display:inline\"":"")+" border=0 cellpadding=0 cellspacing=0><tr><td><table class=dicebg cellpadding=1 cellspacing=0><tr><td><center><font class=dicefont size=\"+1\"><b>"+roll+"</b><br><font size=\"1\">"+numb+" sides"+(addon>0?"+"+addon:addon)+"</font></font></center></td></tr></table></td></tr></table> "); } } } } } } function addRand() { mainForm.message.value=mainForm.message.value.replace(/(\[rand\=\d+\])/ig,""); if((rs.length==0 && mainForm.message.value.match(/(\[dice\=\d+((\+|\-)\d+)?\])/)) && (enablePreview==true || (enablePreview==false && mainForm.nextaction.value=="post"))) { mainForm.message.value+="[rand="+(Math.random()+"").replace(/0\./,"")+(Math.random()+"").replace(/0\./,"")+(Math.random()+"").replace(/0\./,"")+( Math.random()+"").replace(/0\./,"")+"]"; } else { mainForm.message.value+=rs; } disable(mainForm); } </script> My incredibly detailed account of my last few weeks with this code: Back in 2005, a user named "Wonder" wrote a nifty piece of code that fits into any ole ProBoard's global footer. Once installed on a forum, it allows users to type the command [dice=X] where X is the number of sides for the single die they want to roll and it gives them a random result that's very attractive (a small white box with a black border and a bold, large result with smaller text below that reads: Xsides) and not "easy" to change/alter/cheat. To roll more than one die, you simply string the command like [dice=X][dice=X][dice=X][dice=X]. The code also allows for positive modifiers (bonuses) such as [dice=X+Y] where the result has the same compact, attractive format and the small text reads: Xsides+Y Wonder posted that his code would also allow negative modifiers (penalties) but, actually, no one seems to have ever tested that part... until September 2009 when along came pesky me. I went over to the ProBoards support forum because Wonder's code is included in their official database. I posted the problem and a user named Jordan tweaked the code several times, each time getting it closer to providing the correct result. The correct result being that when a user types the command [dice=X-Y] the result is the attractive box, the larger number above and the smaller text below that reads Xsides-Y (in addition to continuing to accept [dice=X] and [dice=X+Y] and offer the same format of results). Jordan's version of the code now does all this. But when I started testing it I realized that whenever a user types a command that gives the die double-digit sides (10, 12, 20, etc), the code now reads it like this: [dice=10] results in 1sides-0 or [dice=12] results in 1sides-2. So double-digit numbers are being read as the number of sides and a negative modifier *sigh* Very bad news. Jordan needed to pass on further work on the code because (understandably) it was taking too much time and it was "messy." Since I am not a coder myself, most JavaScript looks messy to me but I believe Jordan. I then took the code to a pay-by-minute help website but was gently told that the code was so messy that it would take too long to debug and it wouldn't be worth the charge since the roller is being used for a non-profit classroom project for my fourth graders. I thought that was very thoughtful... but I'm back at square one, really. I have attached everything I have: The very original code from Wonder (the one that doesn't read negative modifiers at all) and the latest from Jordan (that reads double-digits incorrectly). The only other cute/attractive thing about the code that I'll point out (so you don't see it in the code and wonder, "What the heck is that?" is: When you install the code into a forum, it adds a tiny die-shaped button to the Add Tags menu. Users can click the little thing and the code automatically inserts [dice=6] for them. Personally, this doesn't help my students and I would love it if the button just inserted [dice=X] but that's fine. *deep breath* Whew! That's about it. Thank you for putting up with my blather. I sincerely appreciate any help you can offer. I know your time is valuable and I've taken quite a bit just posting my full report... I just wanted to try to be verbose :) Jennifer Ooook so this is probably the stupidest question ever. I know in java you can take advantage of a number being an int (not double) and divide by something without getting a remainder. But in javascript you dont declare what kind of variable something is. So my problem is: Given any double or triple digit number, how do i get all but the last digit. Like if i have 13, I need to make an int with 1. If it's 103 i need one with 10. Thanks!! Hello all I'm trying to get this function to check for 10 digits only but alert shows regardless of less / more or exactly 10 digits --- what am I missing? any help on sorting this greatly appreciated. Code: function validate(form) { if (document.forms[0].callme.checked) { var phone = document.forms[0].mobile.value; // assign value to var phone = phone.replace( /[^\d]/g, "" ); // zap all non-digit characters if ( document.forms[0].mobile.length != 10 ) // chk for 10 digits{ alert("Enter 10 numbers"); return false; } else { alert("Yahoo"); } } low tech I have a number var number = 1,235.326232 I need to display it like following with the last 4 numbers in red. 1,235.32 6232 I have tried number.slice(0,-4)+"<font color='red'>"+number.substr(number.length-5,4); however it keeps messing up the comma and decimal placement. Is it possible to convert the getTime() result into an actual number or text type format where the length function can be used to return only the last 2 digits of the number in a text or number format that is NOT a date format? I have spent quite a bit of time hunting for this and suspect that I am attempting the impossible ?? Thanx Disregard - I believe I have figured it out finally!! hi, i'm trying to keep a copy of a variable at 4 digits.. this is what i came up with.. it's working but i'm only a noob, so i would very like to know is there any other simpler and/or elegant way to do this.. also i would appreciate it if you could point out any bad syntax or something.. Code: page = 100 function makeit4digits(){ page4digit = page if (page<10) { page4digit = "000"+ page } else if (page<100) { page4digit = "00"+ page } else if (page<1000) { page4digit = "0"+ page } } Hello, I've obtained the following code. Code: function makeDate(){ var d = new Date(); var strDate=d.getFullYear() + "/" + (d.getMonth()+1) + "/" + d.getDate() + " "; strDate += d.getHours() + ":" + d.getMinutes() +":"+ d.getSeconds() ; return strDate; and I think I'm going to get the time and date indications in 2 digits. I want to get it like this: 2009/12/07 18:07:33 NOT like: 2009/12/7 18:7:33 How should I alter the code? Can anyone help? Thanks in advance. Hi I would like to write a parser like the one below except I would like it to take characters with the the digits like 345j, 982p0, what would I change to be able to have characters with numbers? Code: ts.addParser({ id: "digit", is: function (s, table) { var c = table.config; return $.tablesorter.isDigit(s, c); }, format: function (s) { return $.tablesorter.formatFloat(s); }, type: "numeric" }); I have the following string "d3-23-76-546" I'm looking for a regular expression that will match everything in this string before 546 so that I can replace it with an empty string and just be left with 546. The string could be of any length and contain any number of hyphens. If number is more than 24 digits, modulus operator is not giving correct output here attached sample code [code]<script type="text/javascript"> var a=10000000000000000000000.0; var b=10.0; var c=a % b; alert("c"+c); </script>[code] please tel me solution here is where the code is. http://simplythebest.net/scripts/DHT...script_15.html I need this to be able to open in the parent window not in another window. Or if someone could precribe a double drop box that works in "moonfruit" that would be great. Thank you very much for your time. David the following javascript code is for a page that has to different login sections (username and password) hospital admin i want them to login in their part using normal IDs(numbers) and password, and normal users to login in the other login boxes (using email address and password) , each login boxes have their own submit button. the problem is i can't check each of them alone. what i want to do is that if (for user) email and password entered and pressed his login button, to be headed to another page, while if hospital admin entered his id and password in his section and pressed login button, to be headed for a different page. help please ! Code: window.onload = initForms; function initForms() { for (var i=0; i< document.forms.length; i++) { document.forms[i].onsubmit = function() {return checkFields();} } } function checkFields(){ if(document.getElementById("userLogin").onclick) { if(isEmail(document.getElementById("userUsername").value)==false) { alert("Please enter a valid e_mail address."); document.getElementById("userUsername").focus(); return false; } if(document.getElementById("userUsername").value=="") { alert("Please enter your e_mail address."); document.getElementById("userUsername").focus(); return false; } if(document.getElementById("userPassword").value=="") { alert("Please enter your password."); document.getElementById("userPassword").focus(); return false; } } if(document.getElementById("hospLogin").onclick) { if(document.getElementById("hospUsername").value=="") { alert("Please enter your ID."); document.getElementById("hospUsername").focus(); return false; } if(document.getElementById("hospPassword").value=="") { alert("Please enter your password."); document.getElementById("hospPassword").focus(); return false; } } } function isEmail(mail) { var char1 = mail.split("@"); var y = mail.indexOf("@", 0); var e = mail.indexOf(".", 0); var w = mail.lastIndexOf(".", mail.length - 1); var sp = mail.indexOf(" ", 0); var pl = mail.indexOf("@.", 0); for (i = 0; i < mail.length; i++) { if (mail.charAt(i) == "/" || mail.charAt(i) == ":" || mail.charAt(i) == ";" || sp > 0 || pl > 0 || mail.charAt(i) == '"' || char1.length > 2 || y == -1 || y == 0 || e == 0 || w == mail.length - 1 || e == -1) { return false; } } } and there goes the HTML codes: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="script.css" /> <script type="text/javascript" src="script.js"></script> <title>Blood high res END</title> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div id="apDiv4" style="background:url(images/Blood-high-res-END_04.jpg) no-repeat"></div> <div id="apDiv1" style="background:url(images/Blood-high-res-END_01.jpg)"> <p>Hospital</p> <form name="hospForm" id="hospForm"> <input type="text" name="hospUsername" id="hospUsername" class="reqd" /><br /> <input name="hospPassword" type="password" id="hospPassword" class="reqd" /><br /><br /> <input name="submit" type="submit" id="hospLogin" value="Hospital log in" /></form></div> <div id="apDiv2" style="background:url(images/Blood-high-res-END_02.jpg)"></div> <div id="apDiv3" style="background:url(images/right.jpg)"> <a id="register" href="../User Registration Page/page.html" target="_self">Register Now</a> <a id="links" href="../Links/page.html" target="_self">Links</a> <p>Visitor</p> <form name="userForm" id="userForm"> <input type="text" name="userUsername" id="userUsername" class="reqd" /><br /> <input name="userPassword" type="password" id="userPassword" class="reqd" /><br /><br /> <input name="submit" type="submit" id="userLogin" value="User log in" /><br /></form> <a id="register2" href="../User Registration Page/page.html" target="_self">Register now</a><br /> <a id="forgot" href="../User Forgot Password/page.html" target="_self">Forgot Password</a></div> <div id="apDiv5" style="background:url(images/Blood-high-res-END_05.jpg) no-repeat"></div> <div id="apDiv6" style="background:url(images/Blood-high-res-END_06.jpg) no-repeat"> <p>Hello and welcome to Red Drop. By visiting our page,<br />you ensure to each and every one of the team crew <br />behind the stage, and to every lebanese person that<br />you are mentally prepared to donate a few drops of your<br />blood to the benefit of an anonymous stranger.<br /><br />With every drop you donate, you might be giving<br />a father, a mother or a child another day to live among<br />his family and his beloved persons.<br /><br />Register today and add donation blood to your frequently<br />social and humanitarian activities.</p> </div> <div id="apDiv7" style="background:url(images/Blood-high-res-END_07.jpg) no-repeat"></div> <div id="apDiv8" style="background:url(images/Blood-high-res-END_08.png) no-repeat"></div> <div id="apDiv9" style="background:url(images/Blood-high-res-END_09.jpg) no-repeat"></div> </body> </html> I havent added the server side scripts yet, i am planning to validate forms as much as possible using javascript first, and this is not for a real hospital, it's a graduation project, so to explain the point, on the page i have 2 seperated forms wich each having its own submit button, one to be used by hospital admins, and other to be used by users. For admins i just want to make sure their fields are not empty. For users i want to make sure their fields are not empty and their email field is valid. but when trying it, it's kinda only checks for the user fields. P.S: I apologize about not using codes, i didn't knew about this option. I want to detect the double-press of the space key. However, I want a single press of a space key to have a different function. The double-tap of space should only count if the taps of space are no more than, say, a half second apart. For example: The user hits space once, and javascript begins performing one action. 1/3rd of a second later, they hit the space bar again, and since that is within our threshold of 1/2 of a second, the action that began because the user hit the spacebar once should be cancelled, or undone (which I can write later) and the action when the user hits the spacebar twice should begin. Anyone have an idea how to do this? Thanks! Hey I am almost done with my API boot system and with the way I am calling new files it seems to double boot how can I stop this from happening as the page fully loads and that but the loader shown in the IE tab doesn't stop and it says '1 item remaining' and that never goes, both stay until you click anywhere on the document, so I was wondering if there is a way to stop this. My code to call the js document in the file 'boot.js'. Code: var o = 'http://www.example.com/file.js'; document.write("<script src=\""+o+"\" type=\"text\/javascript\"><\/scr"+"ipt>"); And in index.html I have this script tag Code: <script type="text/javascript" src="http://www.example.com/boot.js"></script> Hi, I have completed the necessary function and it does not need any changes however from the "alert" I need there has to be double quotes surrounding the search 'Lboro'. (I know I may be making a meal of the coding however the lecturer wants us to follow this due to everyone being at different levels of programming). I have used the '\' character however the double quotes do not end up in the position I require them?! My Coding function findAnyU (s){ var a = s , b , c , d , e = -1; for (var i = 0 ; i < pages.length && e == -1 ; i++){ b = pages[i].indexOf('['); c = pages[i].indexOf(']'); d = pages[i].substring(b+1, c).toLowerCase(); e = d.indexOf(s.toLowerCase()); } if(e >= 1) a += ' found' else a += ' not found' return (a) } alert (findAnyU('Lboro' , pages)); Current Alert = Lboro found Cheers George I currently have a Drop-Down menu, which has headers you click on to show the links. This menu only allows one drop to be expanded at a time, and can be viewed here. I would like the headers to be able to have 'sub-headers' inside, which also drop-down,to reveal the links. I want them to have a different header colour, and to have the same rule where only one can be open at a time. while keeping the rule with the main headers. I have previously posted asking this, and got no reply, so I would really greatly appreciate any help and/support! Best Regards, Tim (P.S. I am still only learning JavaScript, and to make the current menu I have, took loads of help for a different project) Hi Can you please advise on this. When writing javascript what is best practice.... single or double quotes? I tried to research this and everyone contracdicts each other? thanks A |