JavaScript - How To Reverse A Drop Down Animation To Drop Up Using Jquery
I have been searching for a long time but have been unsuccessful on how to develop a drop down menu but have the menu items show in a list above the main nav. Not below. I really like the way this functions:
http://www.sohtanaka.com/web-design/examples/toggle/ But I would like the item in the list to appear above the main nav so it animates up not down. Can anyone help me on how to alter this js code to perform this task? Here is the jQuery file link: http://code.jquery.com/jquery-latest.js I tried going through this js file but it very complex. Can anyone tell me what I need to change to have the animation roll up instead of down? Any help would be most appreciated. Similar TutorialsHowdy Community, I have spent the past 4 hours strait looking for and trying to modify an accordion style vertical menu who's elements slide out of the top and up instead of the normal slide out of the bottom and down action. I would like it in jQuery, but at this point I will take any library. Thanks for your help. I know some have wondered "What have you tried making work".. jQuery Tools, Jquery UI and about 3 other scripts that looked updateable. All I couldn't get to work. I also made an attempt to fake an accordion using show/hide toggles and this sorta worked, but it didnt have the nice slide as well as my data didnt move on page in the right direction. Headache!!! Help!! Thanks, Cesar Code: $(document).ready(function(){ $("#logo,#menu").hover( function () { $("#menu").stop().slideDown('fast'); }, function () { $("#menu").stop().slideUp('slow'); } ); }); This menu slides down on hover and slides up on un hover. If I mouse back on either object while slideUp() is happening, the animation stops. Then if i un hover / re-hover , the menu slides down to where i interrupted the initial slideUp(). I'd like for the menu to drop back down if I interrupt slideUp() or some type of solution. How can I do this? I have made a code which is for a 9 tile picture puzzle.And i have done it for click event.now i want to make it possible to drag and drop to swap divs rather than clicking.So how do i swap divs with only javascript.[p.s my divs are dynamically created]
Hello everyone! So, what it does: You can successfully drag something anywhere, but when you click it again, it resets to its original position (I don't know why), and when you try to drag it again, as soon as your cursor touches the object it disappears (I don't know why). I'm hoping someone can tell me why it is happening and how to fix it! Code: // JavaScript Document var posX; var posY; var element; function drag(event) { element = document.getElementById("square"); posX = event.clientX; posY = event.clientY; element.addEventListener("mousemove", move, false); } function move(event) { if (typeof(document.getElementById("square").mouseup) == "undefined") element.addEventListener("mouseup", drop, false); //Prevents redundantly adding the same event handler repeatedly element.style.left = event.clientX - posX + "px"; element.style.top = event.clientY - posY + "px"; } function drop() { element.removeEventListener("mousemove", move, false); element.removeEventListener("mouseup", drop, false); } the html is a simple (position is set to relative): <p id="square" onmousedown="drag(event)">meep</p> Lastly, and most importantly, thank you all for your time =] EDIT: This is the first time I've written javascript code and would like to learn the basics, which is why I am not using a library. I'm working on creating a jQuery book online that utilizes .animate to create nifty effects. I'm nearly finished with the initial animation and design, but have run across a pretty irritating snag. Have a look at http://notebook.dauidusdesign.com to see the problem. The trouble: When you click on the right arrow or hover to see the next page, all works exactly right. But, when you hover on the left arrow, the animation occurs on the wrong side of the page... it should occur on the left side and show the page behind it. I'm pretty sure it comes down to something in the code below, as that is where the majority of hover animations occur. For a look at the rest of the code, visit the site above, view the source and check out the file jquery.booklet.1.1.0.js. The code below begins at line 401. Thanks for the help! Code: //add page hover animations if(opts.hovers){ ctrlsN.hover( function(){ if(!busy && opts.curr+2 <= opts.pTotal-2){ //animate p2.stop().animate({right:5, 'width':opts.pWidth-140, 'height':opts.pHeight}, 800, opts.easing); p2wrap.stop().animate({left:"-5px"}, 800, opts.easing); p3.stop().animate({'left':opts.width-180, 'width':30, paddingLeft: 50}, 800, opts.easing); p3wrap.stop().animate({left:10}, 800, opts.easing); rhover = true; } }, function(){ if(!busy && opts.curr+2 <= opts.pTotal-2){ p2.stop().animate({right:0, 'width':opts.pWidth, 'height':opts.pHeight}, 800, opts.easing); p2wrap.stop().animate({left:0}, 800, opts.easing); p3.stop().animate({'left':opts.width, 'width':0, paddingLeft: 0}, 800, opts.easing); p3wrap.stop().animate({left:0}, 800, opts.easing); rhover = false; } } ); ctrlsP.hover( function(){ if(!busy && opts.curr-2 >= 0){ //animate p1.stop().animate({left:5, 'width':opts.pWidth-140}, 800, opts.easing); p1wrap.stop().animate({right:"-5px", 'right':opts.pWidthH-140}, 800, opts.easing); p0.stop().animate({'right':opts.width-180, left:100, 'width':80}, 800, opts.easing); p0wrap.stop().animate({right:10}, 800, opts.easing); lhover = true; } }, function(){ if(!busy && opts.curr-2 >= 0){ p1.stop().animate({left:0, 'width':opts.pWidth}, 800, opts.easing); p1wrap.stop().animate({right:0, 'right':opts.pWidthH}, 800, opts.easing); p0.stop().animate({'right':opts.width-0, left:0, 'width':0}, 800, opts.easing); p0wrap.stop().animate({right:0}, 800, opts.easing); lhover = false; } } ); } Hello there, CodingForums.com! I'm a newbie to Javascript, HTML, XHTML, CSS-- and oh god, everything, so please bear with me! I have come to understand that to get any better, I'll need support. I hope you guys (and gals) can assist! Here is my issue: I'm currently trying to develop a first-draft calculator that will allow me to calculate some values for work and the way I want it requires me to do it with a pair of drop-downs. Take a look at it he http://www.projectvoid.co.uk/ I would like to select the first drop-down, on the left-hand side (Current Lighting Products -> Type of Lamp) and for the right-hand side to copy it's selected value (Energy Efficient Products -> Type of Lamp). Furthermore, it shouldn't interfere with the fact that I'm also using those values with my dependent drop-down, below (Wattage). The only piece of code I've found that might help is this: Code: function setSelect(name1, name2) { var select1 = document.forms.formname.elements[name1]; var select2 = document.forms.formname.elements[name2]; select1.selectedIndex = select2.selectedIndex; } I am also unsure how to utilize it. I look forward to your aid! Thank you in advance. Okay, I'm having some trouble getting my head around how to do this.. Code: <select> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <select> <option value="Rhino">Rhino</option> <option value="Bird">Bird</option> <option value="Rooster">Rooster</option> </select> <select> <option value="0202A">Rhino - Text</option> <option value="0203A">Rhino - Text2</option> <option value="0204A">Bird - Text1</option> <option value="0205A">Bird - Text2</option> <option value="0202B">Rhino - Text</option> <option value="0204B">Rhino - Text2</option> <option value="0204C">Rooster - Text1</option> <option value="0205C">Rooster - Text2</option> <option value="0206C">Rooster - Text3</option> </select> So say we had those three drop-downs. I'm looking to make it so that second drop-down only has options corresponding to a relationship between the first and the third drop-down. Example - if you select A in the first drop-down you only see Rhino and Bird in the second drop-down. If you select B you will only see Rhino in the second drop-down. Lastly, if you select C you will only see Rooster in the second drop-down. Just can't figure this out. >.< 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 Hello, Current Live View: https://tornhq.com/AroundTheWorld/Lo...WorkingOn.html This content is going to be implemented into a form I am currently working on once completed. As you can see, not all of the countries have yet been broken down as some we're having difficulties doing so. Code: SList.getSelect = function (slist, option) { document.getElementById('scontent').innerHTML = ''; // empty option-content if (SList[slist][option]) { // if option from the last Select, add text-content, else, set dropdown list if (slist == 'scontent') document.getElementById('scontent').innerHTML = SList[slist][option]; else { var addata = '<option>- - -</option>'; for (var i = 0; i < SList[slist][option].length; i++) { addata += '<option value="' + SList[slist][option][i] + '">' + SList[slist][option][i] + '</option>'; } // cases for each dropdown list switch (slist) { case 'slist2': document.getElementById('slist2').innerHTML = txtsl2 + ' <select name="slist2" onchange="SList.getSelect(\'slist3\', this.value);">' + addata + '</select>'; document.getElementById('slist3').innerHTML = ''; break; case 'slist3': document.getElementById('slist3').innerHTML = txtsl3 + ' <select name="slist3" onchange="SList.getSelect(\'scontent\', this.value);">' + addata + '</select>'; break; } } } else { // empty the tags for select lists if (slist == 'slist2') { document.getElementById('slist2').innerHTML = ''; document.getElementById('slist3').innerHTML = ''; } else if (slist == 'slist3') { document.getElementById('slist3').innerHTML = ''; } } } I need to know how to edit the following, if there is a simple way to set the case for each one as they are not all split up into the same way, some are Districts, some states and whatnot so the new question varies. Or do I simply need to make another big list to do them all? Best Regards, Tim Reply With Quote 03-21-2013, 06:35 AM #2 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,311 Thanks 82 Thanked 4,754 Times in 4,716 Posts Well, for starters, this is generally a really bad way to add <select>s and <option>s. Period. I would certainly toss out your entire getSelect() function and rewrite it. But I'm also not clear on what your question is. Are you asking *HOW* to implement the third level? I don't see any countries with any third level data, at this point. If that's what you are asking, one possible way: Code: SList.slist2 = { ... "United Kingdom" : { "England" : ["Staffordshire", "Derby", ... ], "Scotland" : ["Edinburgh", ... ], "Wales" : [ ... ], "Northern Ireland" : [ .... ] }, ... }; I have to ask: Why would you name that Slist.slist2 instead of Slist.countries ?? Not that it really matters, but why not make code more self documenting? I have some Javascript code for a drop-down menu. The code works fine (will show below) but I was wondering how to turn off one of them? I have a total of 8 icons that have drop-down menus, but I only need 6 of them to do so. If I make any sort of change to the code, it makes all the icons change color when the mouse is hovered over, instead of drop-downs. It seems to be an "all or nothing" situation. Can someone show me how to "turn off" just one of the icons (say the "news" one), so a drop-down doesn't appear? Thank you very much. Code: <script language="JavaScript" type="text/JavaScript"> <!-- 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_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_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> <script language="javascript"> function init() { if (TransMenu.isSupported()) { TransMenu.initialize(); menu1.onactivate = function() { document.getElementById("news").className = "hover"; }; menu1.ondeactivate = function() { document.getElementById("news").className = ""; }; menu2.onactivate = function() { document.getElementById("raceresults").className = "hover"; }; menu2.ondeactivate = function() { document.getElementById("raceresults").className = ""; }; } } </script> <tr><td> <a href="http://www.littlevalleyspeedway.com/test/news.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('news','','http://www.littlevalleyspeedway.com/test/layout/nav_news_on.jpg',1)" id="news"><img src="http://www.littlevalleyspeedway.com/test/layout/nav_news_off.jpg" border="0" name="news" /></a><img src="http://www.littlevalleyspeedway.com/test/layout/nav_top_divider.gif" /> <a href="http://www.littlevalleyspeedway.com/test/race_results.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('navraceresults','','http://www.littlevalleyspeedway.com/test/layout/nav_raceresults_on.jpg',1)" id="raceresults"><img src="http://www.littlevalleyspeedway.com/test/layout/nav_raceresults_off.jpg" border="0" name="navraceresults" /></a><img src="http://www.littlevalleyspeedway.com/test/layout/nav_top_divider.gif" /> </td></tr> <script language="javascript"> if (TransMenu.isSupported()) { var ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft); var menu1 = ms.addMenu(document.getElementById("news")); menu1.addItem(); var menu2 = ms.addMenu(document.getElementById("raceresults")); menu2.addItem(); TransMenu.renderAll(); } </script> Any help would be much appreciated!! If you open two tabs, http://www.google.com/imghp and another one, you are able to drag and drop an image from the other tab to the google search tab, and google will search similar images. i can't figure out how that works, does anybody know how? Hi Everyone, I'm trying to put a drop-down menu onto my website, but desperately need some help; I'd be so grateful if someone could offer some assistance. If you click on this link to see the webpage, http://www.ambersupplies.co.uk/newsite/pageone.htm you'll see the drop down menu, and the two problems I'm having with it. Please don't take any notice of the menu content; I'll be styling it all when these problems are sorted. Firstly, you'll see that the external drop down list is lying within the table (with the red background) when it should appear outside. I've obviously missed a closing table or td tag somewhere, but can't find it. Secondly, the drop down menu should appear on mouseover, and disappear on mouseout; which it does, but as you can see, when the page is firstly or reloaded, the menu is showing. I didn't write this drop-down menu code, I copied it from this page with the intention of styling it to my own webpage: http://www.w3schools.com/DHTML/tryit...rydhtml_menu10, perhaps this will give someone a clue. Can anyone shed a bit of light on this for me, please? I'd be really grateful for any help whatsoever. Many thanks in advance. Graham Having trouble with Nested Side Bar menu. I got the coding reference from here and tried to alter it for my profile. http://www.dynamicdrive.com/style/cs...side_bar_menu/ I know there are easier ways to create menus like this with flash, but Im trying to learn with CSS,HTML, JAVASCRIPT.If there is anyone that can help me find an easier solution in how to do menus i would like to take your advice, Basically I wanted to change the image on the button that receives the mouse-over. Then, when i place my mouse over the second button just sits idle with no sub-menu employed. Only the first button receives the commands to employ the sub-menu. This is my Code. ********************************************************** <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" type="text/css" href="4thcss.css"> <script src="4thport.js" type="text/javascript"> </script> <title>Ruddy's Portfolio</title> </head> <body> <div id="container"> <div id="containerbackground"> </div> <div id="header"> </div> <div id="headertitles"> <a href="https://www.google.com">CSS</a> <a href="https://www.google.com">PHP</a> <a href="https://www.google.com">HTML</a> <a href="https://www.google.com">JAVASCRIPT</a> <a href="https://www.google.com">MySQL</a> </div> <div id="content"> <p>Hello, this is my website page!<br> Everything done here is by my <br>creative influence.<br> I Hope that you enjoy!</p> </div> ********************************************************** ********************************************************** <div id="yellowbutton"> <div class="sidebarmenu"> <ul id="sidebarmenu1"> <li><a href="#"></a> <ul> <li><a href="#">Example</a></li> <li><a href="#">Example</a></li> </ul> </li> </ul> </div> </div> <div id="redbutton"> <div class="sidebarmenu"> <ul id="sidebarmenu1"> <li><a href="#"></a> <ul> <li><a href="#">Example</a></li> <li><a href="#">Example</a></li> </ul> </li> </ul> </div> </div> ********************************************************** ********************************************************** <div id="footer"> <div id="footernotes"> <p> A Website by Ruddy J. Woel</p> </div></div> </div> </body> </html> CSS******************************************************* body { background-image:url(Pictures/forest2.jpg); z-index:-1; } #container { width: 860px; margin: 0 auto; height:700px; } #containerbackground { background:#ffff99; position:absolute; top:32px; width:800px; height:700px; opacity:0.8; } #header { background:#009900; position:absolute; top:2px; width:800px; height:29px; opacity:0.8; } #headertitles { position:absolute; top:1px; padding-left:20px; font-size:28px; color:#FFFFFF; font-family:Geneva, Arial, Helvetica, sans-serif; word-spacing:65px; opacity:0.9; } #content { position:absolute; top:70px; left:280px; font-size:16px; font-family:Verdana, Arial, Helvetica, sans-serif; opacity:0.8 } #yellowbutton { position:absolute; top:200px; left:260px; } .sidebarmenu ul{ margin: 0px; padding: 0px; list-style-type:none; font: 18px Verdana; width: 196px; /*main menu width*/ } .sidebarmenu ul li{ position:relative; width:197px; /*sub menu item widths*/ } /* Top level menu links style */ .sidebarmenu ul li a{ display: block; overflow: auto; /*force hasLayout in IE7 */ color: white; text-decoration: none; padding: 6px; height:22px; } .sidebarmenu ul, .sidebarmenu ul li a:visited, .sidebarmenu{ background-image:url(Pictures/yellowbutton.gif); /*background of tabs (default state)*/ } .sidebarmenu ul li a:visited{ color: white; } /*Sub level menu items */ .sidebarmenu ul li ul,.sidebarmenu ul li ul a:visited{ background-image:url(Pictures/menudrop.gif); position: absolute; width: 175px; /*Sub Menu Items width */ top: 0; visibility: hidden; } #redbutton { position:absolute; top:235px; left:260px; z-index:1; } a { text-decoration:none; color:#FFFFFF; word-spacing:40px; } #footer { background-color:#000000; position:absolute; top:733px; height:20px; width:800px; z-index:0; opacity:0.8; } #footernotes { margin-top:-10px; font-family:Geneva, Arial, Helvetica, sans-serif; font-size:14px; z-index:1; color:#FFFFFF; } JAVASCRIPT************************************************* var menuids=["sidebarmenu1"] //Enter id(s) of each Side Bar Menu's main UL, separated by commas function initsidebarmenu(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle" if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item else //else if this is a sub level submenu (ul) ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.display="block" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.display="none" } } for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars ultags[t].style.visibility="visible" ultags[t].style.display="none" } } } if (window.addEventListener) window.addEventListener("load", initsidebarmenu, false) else if (window.attachEvent) window.attachEvent("onload", initsidebarmenu) ******************************************************* Thank you for your time! Here is the JS I used for a drop down nav bar from DW8. I need the cursor to become a hand when you scroll over one of the menu items. Can someone tell me what and where to change this. File attached...
I'm still not quite sure if I'm posting in the right place! I was using FireFox to design a page with a drop down box to select four different links. the script works just fine in FireFox but does nothing in IE8. Does anyone have any suggestions??? Script: <form action="../"> <select onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="">Choose a destination...</option> <option value="./Marrgolf_european_open.html">European OPEN</option> <option value="./Marrgolf_US_open.html">U.S. OPEN</option> <option value="./Marrgolf_masters.html">MASTERS</option> <option value="./Marrgolf_PGA.html">PGA</option> <option value="./Blank_page.html">Reserved</option> </select> </form> Hey complete beginner to javascript here so sorry if I'm doing something stupid Basically I've tried to follow this guide to make it so that I can move an image on the page. I have a style tag in the head Code: <style type="text/css">.drag{position: relative;}</style> I have an image like this: Code: <img src="logo.png" class="drag" alt="logo" /> which is obviously in the body I copied and pasted the code given in the guide: Code: <script language="JavaScript" type="text/javascript"> <!-- var _startX = 0; // mouse starting positions var _startY = 0; var _offsetX = 0; // current element offset var _offsetY = 0; var _dragElement; // needs to be passed from OnMouseDown to OnMouseMove var _oldZIndex = 0; // we temporarily increase the z-index during drag var _debug = $('debug'); // makes life easier InitDragDrop(); function InitDragDrop() { document.onmousedown = OnMouseDown; document.onmouseup = OnMouseUp; } function OnMouseDown(e) { // IE is retarded and doesn't pass the event object if (e == null) e = window.event; // IE uses srcElement, others use target var target = e.target != null ? e.target : e.srcElement; _debug.innerHTML = target.className == 'drag' ? 'draggable element clicked' : 'NON-draggable element clicked'; // for IE, left click == 1 // for Firefox, left click == 0 if ((e.button == 1 && window.event != null || e.button == 0) && target.className == 'drag') { // grab the mouse position _startX = e.clientX; _startY = e.clientY; // grab the clicked element's position _offsetX = ExtractNumber(target.style.left); _offsetY = ExtractNumber(target.style.top); // bring the clicked element to the front while it is being dragged _oldZIndex = target.style.zIndex; target.style.zIndex = 10000; // we need to access the element in OnMouseMove _dragElement = target; // tell our code to start moving the element with the mouse document.onmousemove = OnMouseMove; // cancel out any text selections document.body.focus(); // prevent text selection in IE document.onselectstart = function () { return false; }; // prevent IE from trying to drag an image target.ondragstart = function() { return false; }; // prevent text selection (except IE) return false; } } function ExtractNumber(value) { var n = parseInt(value); return n == null || isNaN(n) ? 0 : n; } function OnMouseMove(e) { if (e == null) var e = window.event; // this is the actual "drag code" _dragElement.style.left = (_offsetX + e.clientX - _startX) + 'px'; _dragElement.style.top = (_offsetY + e.clientY - _startY) + 'px'; _debug.innerHTML = '(' + _dragElement.style.left + ', ' + _dragElement.style.top + ')'; } function OnMouseUp(e) { if (_dragElement != null) { _dragElement.style.zIndex = _oldZIndex; // we're done with these events until the next OnMouseDown document.onmousemove = null; document.onselectstart = null; _dragElement.ondragstart = null; // this is how we know we're not dragging _dragElement = null; _debug.innerHTML = 'mouse up'; } } //--> </script> I have tried putting the javascript in the head and the body but no matter where I put it, I can't drag and drop the image. What am I doing wrong? Thank you for your time Hi! I was wondering if anyone could help with the code below. I think there is something wrong with the "thecontents[] part below. Could anyone have a look and possible email me with a finished version... Code: <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%"><form name="ddmessage"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%"><select name="selectbox" size="1" onChange="changecontent(this)"> <option selected value="What is JavaScript?">What is JavaScript?</option> <option value="Why learn JavaScript?">Why learn JavaScript?</option> <option value="What do you think of the site?">What do you think of the site?</option> <option value="I'd like to feature one of these codes on my site.">I'd like to feature one of these codes on my site.</option> </select><br> </td> </tr> <tr> <td width="100%"><textarea rows="8" name="contentbox" cols="35" wrap="virtual"></textarea><br> <font face="arial" size="-2">This free script provided by <a href="http://javascriptkit.com">JavaScript Kit</a></font> </td> </tr> </table> </form> </td> </tr> </table> <p> <script language="JavaScript"> /* Drop down messages script By JavaScript Kit (http://javascriptkit.com) Over 400+ free scripts here! */ //change contents of message box, where the first one corresponds with the first drop down box, second with second box etc var thecontents=new Array() thecontents[0]='Its what I used to make this :/' thecontents[1]='I wouldn't reccommend it, its rather hard. Though, I hate to blow ones own trumpet, I am learning to do it rather well.' thecontents[2]='I hope you have enjoyed it! Email support@matthewjmorris.co.uk with your comments. Also, if you have any bits to go on this page, email Support aswell with the code, instructions for installing the code and your name! Your name may appear here, along with your code!' thecontents[3]='support@matthewjmorris.co.uk' //don't edit pass this line function changecontent(which){ document.ddmessage.contentbox.value=thecontents[which.selectedIndex] } document.ddmessage.contentbox.value=thecontents[document.ddmessage.selectbox.selectedIndex] </script> Thanks! Hi everyone - I was wondering how it would be possible for me to create a FAQ with drop-down answers when the question is clicked? For example: https://www.facebook.com/help/?page=1145 Facebook has something like that available. Any ideas? I need some code to make it so if one option is selected on drop down A then only certain options are available on dropdown B. Likewise, if a different option on dropdown A is selected, different options are available on dropdown B etc etc. They can either be greyed out, or not visible at all I think i can use Code: <option disabled="disabled"> but i'm not sure how to implement it any help appreciated i have done dropdown menu dynamic using php in which data fetched from database(mysql).now i've to do that if i'll choose any option from dropdown menu that particular item's rate will also fetch from data base and display in a text box.that value can also be changed.plzz help me .give some idea.
|