JavaScript - Js Menu & Drupal
Hello!
I'm start to learn javascript recently. Now i want create dynamic js menu like this http://www.drwilliamchong.com/ and using this in drupal CMS-based site. Problems with Drupal should not be, main question - realisation on js. Do you take to me any information about it or/and life samples adn code Similar TutorialsHi Exprts, I am using a (anylink)javascript menu from dynamic drive. Basically I am having a design issue but posting the problem here because I think this can be fixed through JS. Please download the attached files. You will see the menu & the sub menu on mouse over. Problem is that.... when the submenu appears & I take my mouse to the sub menu, the parent item hover style disappears. I mean, it doesn't look active. I just want the parent item active when users moves his/her mouse to sub menu. Thats all. Please suggest me any solutions for this. Thank you in advance. I'm creating a menu using html, css and a javascript, I found a tutorial to follow online. What I am trying to achieve is when the mouse hovers over the menu items, each item will have a different colour background. the problem is that i can do this but it only works with one colour and not different colours. this is the html: Code: <ul> <li><a href="1.php">Things</a></li> <li><a href="2.php">Animals</a> <ul> <li><a href="2-1.php">Cani</a> <ul> <li><a href="2-1-1.php">Domestic dogs</a></li> <li><a href="2-1-2.php">Wolves</a></li> </ul> </li> <li><a href="2-2.php">Felidae</a> <ul> <li><a href="2-2-1.php">Domestic cats</a></li> <li><a href="2-2-2.php">Wild cats</a></li> </ul> </li> </ul> </li> <li><a href="3.php">Humans</a></li> </ul> the css is as follows: Code: div#s1 { width: 200px; /* menu width */ } div#s1 ul { background-color: #036; list-style-type: none; /* get rid of the bullets */ padding:0; /* no padding */ margin:0; /* no margin for IE either */ } div#s1 ul li { margin: 0; padding: 0; background-color: #036; display:block; border-top: 1px solid white; /* lines */ } div#s1 ul li a { display: block; /* lines extend to right, make area clickable */ color: white; background-color: #036; padding: 3px 3px 3px 23px; margin:0; text-decoration: none; height:15px; /* hint for IE, alternatively remove whitespace from HTML */ } div#s1 ul ul li a { margin-left: 20px; /* indent level 1 */ } div#s1 ul ul ul li a { margin-left: 40px; /* indent level 2 */ } div#s1 ul ul ul ul li a { margin-left: 60px; /* indent level 3 */ } div#s1 li ul, div#s1 li.open li.closed ul { display: none; /* collapse */ } div#s1 li.open ul { display: block; /* expand */ } div#s1 ul li.open a { background-image: url(bullet_open.gif); background-repeat: no-repeat; } div#s1 ul li.closed a { background-image: url(bullet_closed.gif); background-repeat: no-repeat; } div#s1 ul li.leaf a { background-image: url(bullet_leaf.gif); background-repeat: no-repeat; } div#s1 li.active a { background-position: 0px -20px; color: red; /* highlight text */ } div#s1 li.active li a { background-position: 0px 0px; color: white; /* fix lower levels */ } div#s1 ul li a:hover { color: red; background-color: #06C; /* rollover effect */ } and finally the javascript: Code: var menu_active_class = "active"; var menu_leaf_class = "leaf"; var menu_open_class = "open"; var menu_closed_class = "closed"; //the default page that is displayed if URL ends in / var menu_default_page = "index.php"; var menu_url; //main function //menu_id : id of the element containing the navigation function menu_main(menu_id) { var url = location.href; if (url.lastIndexOf("/") == (url.length-1)) { url = url+menu_default_page; } if (url.lastIndexOf("?") >= 0) { url = url.substring(0, url.lastIndexOf("?")); } if (url.lastIndexOf("#") >= 0) { url = url.substring(0, url.lastIndexOf("#")); } menu_url = url; var main = document.getElementById(menu_id); if (!main) alert("No element with id '"+ menu_id +"' found"); menu_traverse(main); } /* Walks down the subtree and on the way back sets properties. returns bit set 1: set = element is a node, unset = element is a leaf 2: set = element contains the active node 4: set = element is the active A node */ function menu_traverse(element) { var props = 0; // walk down for (var i=0; i<element.childNodes.length; i++) { var child = element.childNodes[i]; props |= menu_traverse(child); // aggregate bits } // on the way back now switch (element.tagName) { case "UL": props |= 1; break; case "LI": var c1 = (props & 1) ? ((props & (2|4)) ? menu_open_class : menu_closed_class) : menu_leaf_class; element.className = element.className ? element.className+" "+c1 : c1; if (props & 4) { if (!(props & 2)) element.className += " "+menu_active_class; props |= 2; props &= 1 | 2; // reset bit 4 } break; case "A": if (props & 2) break; // once is enough var href = element.getAttribute("href"); if (menu_isSameUrl(menu_url, href)) props |= 4; break; } return props; } //matches two URIs when href is the last part of url //.. and . are correctly resolved function menu_isSameUrl(url, href) { var a = url.split(/[?\/]/i); var b = href.split(/[?\/]/i); var i = a.length - 1; var j = b.length - 1; while ((i >= 0) && (j >= 0)) { if (b[j] == "..") { j-=2; continue; } if (a[i] == "..") { i-=2; continue; } if ((b[j] == ".") || (b[j] == "")) { j--; continue; } if ((a[i] == ".") || (a[i] == "")) { i--; continue; } if (! (a[i] == b[j])) return false; i--; j--; } return true; } New to this forum but hope this will explain my problem, any help is much appreciated! thanks!! Jesper Hi all, this is my first post so forgive me for any errors but i'll try and give all the information i can. i use Xara Designer Pro and i have used a 3rd party software to create a html menu however i have a html loading screen on my site and the menu always appears on top of the screen and while the screen is loading, this is the only thing that appears on top everything else is fine, i have put this to the people on the xara forums and the opinion is that its probably the JS file that the menu is using that is telling it to appear on top. i was wondering what i should look for to determin this problem or if someone could take a look at it for me? i'll upload the JS here and see if anyone can help. my site is at www.pcevo.co.uk however you need to CTRL + F5 to refresh wihtout the cache to see the loading screen if you are on a fast connection.
I am having trouble with a sub-menu of the 1st item only and can not seem to figure it out. All the others are fine. Any help is appreciated. Here is the code: var NoOffFirstLineMenus=7; // Number of first level items var LowBgColor='white'; // Background color when mouse is not over var LowSubBgColor='white'; // Background color when mouse is not over on subs var HighBgColor='black'; // Background color when mouse is over var HighSubBgColor='black'; // Background color when mouse is over on subs var FontLowColor='black'; // Font color when mouse is not over var FontSubLowColor='black'; // Font color subs when mouse is not over var FontHighColor='white'; // Font color when mouse is over var FontSubHighColor='white'; // Font color subs when mouse is over var BorderColor='black'; // Border color var BorderSubColor='black'; // Border color for subs var BorderWidth=1; // Border width var BorderBtwnElmnts=1; // Border between elements 1 or 0 var FontFamily="arial,comic sans ms,technical" // Font family menu items var FontSize=9; // Font size menu items var FontBold=1; // Bold menu items 1 or 0 var FontItalic=0; // Italic menu items 1 or 0 var MenuTextCentered='center'; // Item text position 'left', 'center' or 'right' var MenuCentered='center'; // Menu horizontal position 'left', 'center' or 'right' var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static var ChildOverlap=.2; // horizontal overlap child/ parent var ChildVerticalOverlap=.2; // vertical overlap child/ parent var StartTop=05; // Menu offset x coordinate var StartLeft=05; // Menu offset y coordinate var VerCorrect=0; // Multiple frames y correction var HorCorrect=0; // Multiple frames x correction var LeftPaddng=3; // Left padding var TopPaddng=2; // Top padding var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL var MenuFramesVertical=1; // Frames in cols or rows 1 or 0 var DissapearDelay=1000; // delay before menu folds in var TakeOverBgColor=1; // Menu frame takes over background color subitem frame var FirstLineFrame='navig'; // Frame where first level appears var SecLineFrame='space'; // Frame where sub levels appear var DocTargetFrame='space'; // Frame where target documents appear var TargetLoc=''; // span id for relative positioning var HideTop=0; // Hide first level when loading new document 1 or 0 var MenuWrap=1; // enables/ disables menu wrap 1 or 0 var RightToLeft=0; // enables/ disables right to left unfold 1 or 0 var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover var WebMasterCheck=0; // menu tree checking on or off 1 or 0 var ShowArrow=1; // Uses arrow gifs when 1 var KeepHilite=1; // Keep selected path highligthed var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height function BeforeStart(){return} function AfterBuild(){return} function BeforeFirstOpen(){return} function AfterCloseAll(){return} // Menu tree // MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width); // For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg" Menu1=new Array("Home","","",3); Menu1_1=new Array("The Ayllu","The Ayllu.htm","",0,20,150); Menu1_2=new Array("Acknow","Acknowledgement.htm","",0); Menu1_3=new Array("Prayer","Prayer.htm","",0); Menu2=new Array("About Us","","",4); Menu2_1=new Array("Debra","bio.htm","",0,20,150); Menu2_2=new Array("Seamus","Seamus.htm","",0); Menu2_3=new Array("Locations","location.htm","",0); Menu2_4=new Array("Contact Us","contact.htm","",0); Menu3=new Array("Services","","",7); Menu3_1=new Array("Shamanic Healing","http://www.Ayllu.us/Shamanic Healing.htm","",0,20,150); Menu3_2=new Array("Shamanic Counseling","http://www.Ayllu.us/Shamanic Counseling.htm","",0); Menu3_3=new Array("Sacred Ceremonies","http://www.Ayllu.us/Sacred Ceremonies.htm","",0); Menu3_4=new Array("Sacred Body Work","http://www.Ayllu.us/sbw.htm","",0); Menu3_5=new Array("Full Moon Crystal Bowl","http://www.Ayllu.us/fm.htm","",0); Menu3_6=new Array("Sound Healing","http://www.Ayllu.us/Sound Healing.htm","",0); Menu3_7=new Array("LaHo-Chi","http://www.Ayllu.us/lahochi.htm","",0); Menu4=new Array("Calendar","http://www.ayllu.us/calendar.htm","",0); Menu5=new Array("Gallery","http://www.ayllu.us/gallery.html","",0); Menu6=new Array("Articles","","",3); Menu6_1=new Array("Test 1","http://www.Ayllu.us/blank.htm","",0,20,150); Menu6_2=new Array("Test 2","http://www.Ayllu.us/blank.htm","",0); Menu6_3=new Array("Test 3","http://www.Ayllu.us/blank.htm","",0); Menu7=new Array("Links","http://www.ayllu.us/links.htm","",0); ? how would i make it for a menu so you could press it and it would go down to click on a link.
Hello all, I am currently looking to create a JavaScript menu for a website I am working on. It currently expands and collapses on click. The code in question is pasted below:- menu_status = new Array(); function showHide(theid){ if (document.getElementById) { var switch_id = document.getElementById(theid); if(menu_status[theid] != 'show') { switch_id.className = 'show'; menu_status[theid] = 'show'; }else{ switch_id.className = 'hide'; menu_status[theid] = 'hide'; } } } As you can see, it basically shows and hides the menu (when clicked). I want it to open the menu when clicked and close when another menu is opened. I have looked and have not been able to find a solution into it. Ideally I donot want it to be a long piece of code as I do have a working menu but with many more lines of JavaScript than the one I have posted. I need a solution to it urgently, your help is appreciated. Thanks Hi there, I am trying to create "sideways" sub menus off of my main vertical menu images. (Something like this example: http://netweblogic.com/demos/ddm/vddm-nomoo.htm but in the place of Menu Item 1, Menu Item 2, Menu Item 3 there would be roll over images.) The main vertical menu items I have are rollover images. I would like the sub menu to appear when you hover over the main menu item. When I attempt this using the above example, all of my other CSS and JS does not work. Any help on how to link my rollover menu images to the sub menu would be greatly appreciated! Thanks in advance! Here is the code for my menu (I have only included 2 menu items here, if you need more info please let me know): Code: <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onload="MM_preloadImages('images/buttons/teamandcorpsports.jpg','images/buttons/performancesports.jpg','images/buttons/flagsandbanners.jpg','images/buttons/home.jpg','images/buttons/catalogues.jpg','images/buttons/galleries.jpg','images/buttons/designown.jpg','images/buttons/dealerlogin.jpg','images/buttons/contactus.jpg','images/buttons/dealersignup.jpg')"> <div id="wrapper"> <div id="header"> <h1> </h1> </div> <!-- Main content --> <div id="content"> <div style="text-align:center"> <img id="pic" src="images/slideshow/slideshow1.jpg" width="600" height="600" alt="slideshow" /> </div> <script type="text/javascript" src="slideshow.js"></script> </div> <!-- Site navigation menu --> <div id="navcontainer"> <ul> <li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('teamandcorpsports1','','images/buttons/teamandcorpsports.jpg',1)"><img src="images/buttons/teamandcorpsports1.jpg" alt="Team and Corporate Sports" name="teamandcorpsports1" width="224" height="37" border="0" id="teamandcorpsports1" /></a></li> <li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('performancesports1','','images/buttons/performancesports.jpg',1)"><img src="images/buttons/performancesports1.jpg" alt="Performance Sports" name="performancesports1" width="224" height="37" border="0" id="performancesports1" /></a></li> Here is my CSS code for the menu, not sure if this is where the issue is? Code: /* navigation menu */ #navcontainer ul { margin: 0; padding: 0; list-style-type: none; /* removes bullets */ background-image:url('background.jpg'); } #navcontainer li { margin: 0 0 0 0; /* separates list items */ } #navcontainer a { display: block; /* achieves rollover */ width: 250px; /* list width */ text-decoration: none; } I know how to edit the CSS, and minute parts of the JavaScript code (for example; speed of the drop). The problem is, I had a massive amount of help making the Javascript side of the menu, and do not know how to edit it... I want the rules to still apply, where only one can be expanded at a time (one of the first drops, and then only one of the sub-drops). I noticed in the code, I can edit it so there can be more than one drop, but that would mean, the whole menu could be expanded Also, I want my sub-drops. to have different span colour than the main drop. but trhe links and such, (everything else about it) can be the same.... My live demo is here! Thank you for any help and/or advice in advance, Best Regards, Tim Hi! I'm relatively new to JavaScript, though I've done some PHP and Java programming before. Still, be gentle . I have a menu with some images as the links. These images have onmouseover() and onmouseout() functions where the image is changed (onmouseover makes the image blue, while the onmouseout restores the original white). Now, my problem is that I also want to make the link corresponding to the currently open page to stay blue all the time, but I cannot for the life of me figure out how to do it. I've tried with onClick="document.[IMG].src='blue'" but clearly, as the page reloads to open the chosen link, the image is reset to white. I've also tried some other, unsuccessful solutions that don't need mentioning here... How do I make the image stay blue even when the page is reloaded? I'd be really happy if you could point me towards some examples of this being done. This is parts of my code (it's not much and I know it's a bit of a mess, it's in the developmental stages...): Code: function printHTMLTop() { var html = '<div class="main" id="main"> \ <div class="header" id="header">\ <div class="topHeader" name="topHeader"> \ <div class="logo" name="logo"><a href="index.php"><img src="logoBlue02.png" /></a></div> \ \ </div> \ <div class="midHeader" name="midHeader"><img src="midHeadImg.png" /></div> \ <div class="bottomHeader" name="bottomHeader"> \ <div class="menu" name="menu"><a href="index.php"><img name="hem" id="hem" src="menu_HemW.png" onmouseover="document.hem.src=\'menu_HemB.png\'" onmouseout="document.hem.src=\'menu_HemW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="Contract.php"><img name="skapa" src="menu_SkapakontraktW.png" onmouseover="document.skapa.src=\'menu_SkapakontraktB.png\'" onmouseout="document.skapa.src=\'menu_SkapakontraktW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="gbookAdd.php"><img name="gbook" src="menu_GbookW.png" onmouseover="document.gbook.src=\'menu_GbookB.png\'" onmouseout="document.gbook.src=\'menu_GbookW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="Forskning.html"><img name="forskning" src="menu_ForskningW.png" onmouseover="document.forskning.src=\'menu_ForskningB.png\'" onmouseout="document.forskning.src=\'menu_ForskningW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="Intervjuer.html"><img name="intervju" src="menu_IntervjuerW.png" onmouseover="document.intervju.src=\'menu_IntervjuerB.png\'" onmouseout="document.intervju.src=\'menu_IntervjuerW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="Ungdom.html"><img name="ungdom" src="menu_UngdomW.png" onmouseover="document.ungdom.src=\'menu_UngdomB.png\'" onmouseout="document.ungdom.src=\'menu_UngdomW.png\'" /></a></div> \ <div class="menu" name="menu"><a href="Lankar.html"><img name="lank" src="menu_LankarW.png" onmouseover="this.src=\'menu_LankarB.png\'" onmouseout="this.src=\'menu_LankarW.png\'" /></a></div> \ </div> \ </div> \ <div class="mid" id="mid">'; document.write(html); } Thanks for your help! Hello, I posted a question on here last week about using two independent yet identical javascript menus, visible he http://rebeccabersohn.com/ They are working perfectly in Firefox, but seem to be having some problems in Safari. Occasionally they work, however after a reload they seem to get "stuck". I have not been able to test the page on any other browsers, but of course it would be ideal if it could work everywhere (even ie6!!) I'm new to javascript and am unable to locate my problem. Thank you! Hi All, I want an accordion menu and which is as follows 1.it should be a vertical accordion menu 2.every menu should display with image and link 3.if i click on image or link then only menu should display or open to show sub menu otherwise it should not display. Please tell the solution for the above ThanksAhead Venkat I recently created my first theme shortly after leaning css, but i am having trouble with my navbar. The main bar is a list with images, then when a user hovers over one a list drops horizontally on the bar below. Problem is when trying to click far off links it is very easy to slip and the menu disappears. What i need is some sort of delay to prevent this, or some way to make the menu show after clicking instead of hovering. Here is my code, i have two questions; 1) I have never written a theme before, is this the proper way to code a navbar? (i hear making an actual list is important) 2) How can i add a hover delay or change the submenu to be click activated? Here is a link to my test site so you can see it in action. Code: div#navi { width: 960px; height: 39px; } ul.navi { margin:-2px 0px -2px -40px; } ul.navi, ul.navi li { float: left; list-style:none; } ul.navi li ul { display: none; } ul.navi li:hover ul { display:block; list-style: none; position:absolute; } ul.navi li:hover ul li { padding-right:50px; } ul.navi li:hover ul li a{ color:#FFF; } ul.navi li:hover ul li a:hover{ color:#FFF; } div#navi2 { width: 960px; height: 29px; background-image:url(images/nav_bottom.gif); margin-top:-5px; Code: <div id="navi"> <ul class="navi"> <li><a href="/index.php"><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_01.gif" /></a> <ul> <li><a href="/index.php?site=news">News</a></li> <li><a href="/index.php?site=news&action=archive">Archives</a></li> <li><a href="/index.php?site=articles">Articles</a></li> <li><a href="/index.php?site=calendar">Calendar</a></li> <li><a href="/index.php?site=faq">FAQ</a></li> <li><a href="/index.php?site=search">Search</a></li> </ul> </li> <li><a href="/index.php?site=forum"><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_02.gif" /></a></li> <li><a href="/index.php?site=squads"><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_03.gif" /></a> <ul style="margin-left:-255px;"> <li><a href="/index.php?site=about">About Us</a></li> <li><a href="/index.php?site=squads">Squads</a></li> <li><a href="/index.php?site=members">Members</a></li> <li><a href="/index.php?site=clanwars">Matches</a></li> <li><a href="/index.php?site=history">History</a></li> <li><a href="/index.php?site=awards">Awards</a></li> </ul> </li> <li><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_04.gif" /> <ul style="margin-left:-320px;"> <li><a href="/index.php?site=forum">Forums</a></li> <li><a href="/index.php?site=guestbook">Guestbook</a></li> <li><a href="/index.php?site=registered_users">Registered Users</a></li> <li><a href="/index.php?site=whoisonline">Online Users</a></li> <li><a href="/index.php?site=polls">Polls</a></li> <li><a href="/index.php?site=server">Servers</a></li> </ul> </li> <li><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_05.gif" /> <ul style="margin-left:-330px;"> <li><a href="/index.php?site=files">Downloads</a></li> <li><a href="/index.php?site=tutorials">Tutorials</a></li> <li><a href="/index.php?site=movies">Movies</a></li> <li><a href="/index.php?site=gallery">Photos</a></li> <li><a href="/index.php?site=links">Weblinks</a></li> <li><a href="/index.php?site=demos">Demos</a></li> </ul> </li> <li><img src="/themes/CGS_FutureWeb_Blue/images/nav_top_06.gif" /> <ul style="margin-left:-710px;"> <li><a href="/index.php?site=sponsors">Sponsors</a></li> <li><a href="/index.php?site=partners">Partners</a></li> <li><a href="/index.php?site=newsletter">Newsletter</a></li> <li><a href="/index.php?site=contact">Contact Us</a></li> <li><a href="/index.php?site=challenge">Fight Us</a></li> <li><a href="/index.php?site=joinus">Join Us</a></li> <li><a href="/index.php?site=linkus">Link Us</a></li> <li><a href="/index.php?site=imprint">Imprint</a></li> </ul> </li> </ul> </div> <div id="navi2"></div> Here are the two js scripts i tried, honestly I am not sure how to use them and couldn't get either to work. I think i installed them in the proper places, but i dont think i edited them to work properly; Code: var delay = 500; /* milli seconds */ function attachHooks() { var menu = document.getElementById("navi"); var menuItems = menu.getElementsByTagName("ul.navi li ul"); currentHover = menuItems[0]; for (var i = 0; i < menuItems.length; i++) { menuItems[i].onmouseover = function () {activateMenuWithDelay(this);}; menuItems[i].onmouseout = function () {deactivateMenuWithDelay(this);}; } } function activateMenuWithDelay(ele) { if(ele.timer) { clearTimeout(ele.timer); } ele.timer = setTimeout(function(){activateShowMenu(ele)}, delay); } function activateShowMenu(ele) { var parent = ele; parent.className = "showMenu"; } function deactivateMenu(ele) { var parent = ele; parent.className = " "; } function deactivateMenuWithDelay(ele) { if(ele.timer) { clearTimeout(ele.timer); } ele.timer = setTimeout(function(){deactivateMenu(ele)}, delay); } function initMenuDelay() { attachHooks(); deactivateMenu(); } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(attachHooks); Code: <script type="text/javascript"> sfHover = function() { var sfEls = document.getElementById("navi").getElementsByTagName("li"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> Any help is appreciated! i am using chained combox in a form. in coda-slider. but (not first) in other tab chained combobox is not run (mycodes is in attachment) my codes is in attachment Hi everyone please i want to make a menu like the attached image i tried to make it with many software but i did not get the same view so can anyone help me? thanks in advance i want to make a floating menu.. but the administrator want it to be selected from database... Does anyone have an idea? or how to make it? also i want to know if it can be done or not???? Hi I have a form. In this form i have a pop down menu with 1,2,3,4,5 numbers in it. And after that i have 8 more form fields. what i want is when user select any number from pop down menu then these 8 fields should appear. for example when user select 2 from pop down menu then then these set of fields should appear twice i mean 8+8=16. and so on. my code is here 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" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <p> <select name="jumpMenu" id="jumpMenu"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </p> <p> Type : <select name="jumpMenu2" id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)"> <option value="Delux">Delux</option> <option value="king">king</option> <option value="exe">exe</option> </select> </p> <p> <label>Number: <input name="textfield" type="text" id="textfield" size="5" /> </label> </p> <p> <label>Name: <input type="text" name="textfield2" id="textfield2" /> </label> </p> <p>Date Arr: <label> <input type="text" name="textfield3" id="textfield3" /> </label> </p> <p>Dep Date: <label> <input type="text" name="textfield4" id="textfield4" /> </label> </p> <p> <label> <input type="checkbox" name="checkbox" id="checkbox" /> Extra</label> </p> <p> <label> <input type="checkbox" name="checkbox2" id="checkbox2" /> Park</label> </p> <p>Remarks: <label> <textarea name="textarea" id="textarea" cols="45" rows="5"></textarea> </label> </p> </form> </body> </html> how this can be done in js Need Help with Spry Menu Bar This is the site I am working on: http://www.alpinelakesair.com/newsite/index.php To quickly summarize: (without getting into the *why* of things) - the website has only two pages: 1=index.php, 2=charter-flights.php - the homepage links to specific tabs within the spry region of the main menu bar, which is located on page the 2nd page. - all the sub pages of the site are located within the spry content of the spry tabs of the menu bar (this is so the header image never has to reload) So, the idea goes that you click on the tabs of the home page and it brings you to the 2nd page with the corresponding menu bar item already highlighted. The pages work in Safari and Firefox on my Mac - but - when you try click on the first four tabs from the homepage in Internet Explorer it doesn't open any content. If you click on the last three tabs it opens content - but all the content, and the sub-spry regions do not work... I am new to spry, so if you help please make your answers for someone with a little but not much spry knowledge. Please let me know if more information is needed.. I am reposting this as the issue has not been resolved... alex Hi, Please look at the following drop-down menu: http://www.w3schools.com/JS/tryit.as...yjs_selectmenu 1. How can I set it so the pages open in the parent frame (instead of the same frame)? 2. How can I set it so the pages open in a new window? Regards Rain Lover i want to activate a dropdown menu with a lot of submenus and i have function setActive() { aObj = document.getElementById('nav').getElementsByTagName('a'); for(i=0;i<aObj.length;i++) { if(document.location.href.indexOf(aObj[i].href)>=0) { aObj[i].className='active'; } } } window.onload = setActive; but it activate me only the sub butons and i want the primary - the top buton active i have a css class separated can you help me ? what should i add in the code? |