473,379 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Jquery menu mouseover

347 100+
I have a JQuery menu that works fine on mouseover mouseout for opening and closing but i am trying to make it open on click then stay open till mouse out.

The code i have is this

Expand|Select|Wrap|Line Numbers
  1. // JavaScript Document
  2.  
  3. $(document).ready(function () {
  4. // <![CDATA[
  5.     var timeout    = 500;
  6.     var closetimer = 0;
  7.     var ddmenuitem = 0;
  8.  
  9.     function ddmenu_open(){
  10.         ddmenu_canceltimer();
  11.            ddmenu_close();
  12.            ddmenuitem = $(this).find('ul').css('visibility', 'visible');
  13.            $('#biog').css('visibility', 'hidden');
  14.     }
  15.  
  16.     function ddmenu_close(){
  17.         if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
  18.         $('#biog').css('visibility', 'visible');
  19.     }
  20.  
  21.     function ddmenu_timer(){
  22.         closetimer = window.setTimeout(ddmenu_close, timeout);
  23.     }
  24.  
  25.     function ddmenu_canceltimer(){ 
  26.         if(closetimer){ 
  27.             window.clearTimeout(closetimer);
  28.                 closetimer = null;
  29.     }}
  30.  
  31.     $(document).ready(function(){ 
  32.         $('#ddmenu > li').bind('click', ddmenu_open);
  33.         $('#ulAgesid').bind('mouseout',  ddmenu_timer);
  34.         $('#ulUKAccentsid').bind('mouseout',  ddmenu_timer);
  35.         $('#ulStylesid').bind('mouseout',  ddmenu_timer);
  36.         $('#ulWorldAccentsid').bind('mouseout',  ddmenu_timer);
  37.         $('#ulForeignLanguagesid').bind('mouseout',  ddmenu_timer);
  38.     });
  39.  
  40.  
  41. // ]]>  
  42. });
HTML for the menu is this whick is dynamically generated with asp

Expand|Select|Wrap|Line Numbers
  1. <ul id="ddmenu">
  2.  <li><a href="boys2.asp?id=386&voicetype=All" id="maintab">Main Page</a></li>
  3.  
  4.  
  5.  
  6.     <li><a href="javascript:void(0)"  id="UKAccentsidtab">UK Accents</a>
  7.         <ul id="ulUKAccentsid">
  8.  
  9.         <li><div  class="liUKAccentsidtext"><a href="boys2.asp?id=386&voicetype=Neutral" >Neutral</a></div></li>
  10.  
  11.         <li><div  class="liUKAccentsidtext"><a href="boys2.asp?id=386&voicetype=Irish" >Irish</a></div></li>
  12.  
  13.         <li><div  class="liUKAccentsidtext"><a href="boys2.asp?id=386&voicetype=Scottish" >Scottish</a></div></li>
  14.  
  15.  
  16.         </ul>         
  17.     </li>
  18.  
  19.  
  20.  
  21.     <li><a href="javascript:void(0)"  id="Agesidtab">Ages</a>
  22.         <ul id="ulAgesid">
  23.  
  24.         <li><div  class="liAgesidtext"><a href="boys2.asp?id=386&voicetype=20s-30s" >20's - 30's</a></div></li>
  25.  
  26.         <li><div  class="liAgesidtext"><a href="boys2.asp?id=386&voicetype=30s" >30s</a></div></li>
  27.  
  28.         <li><div  class="liAgesidtext"><a href="boys2.asp?id=386&voicetype=30s-40s" >30's - 40's</a></div></li>
  29.  
  30.  
  31.         </ul>         
  32.     </li>
  33.  
  34.  
  35.  
  36.     <li><a href="javascript:void(0)"  id="Stylesidtab">Styles</a>
  37.         <ul id="ulStylesid">
  38.  
  39.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Animation/Cartoon" >Animation/Cartoon</a></div></li>
  40.  
  41.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Authoritative" >Authoritative</a></div></li>
  42.  
  43.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Characterful/Quirky" >Characterful/Quirky</a></div></li>
  44.  
  45.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Comedy/Humorous" >Comedy/Humorous</a></div></li>
  46.  
  47.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Deep/Powerful/Dramatic" >Deep/Powerful/Dramatic</a></div></li>
  48.  
  49.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Documentary/Corporate" >Documentary/Corporate</a></div></li>
  50.  
  51.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Friendly/Upbeat" >Friendly/Upbeat</a></div></li>
  52.  
  53.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Impressions" >Impressions</a></div></li>
  54.  
  55.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Kid-Friendly" >Kid Friendly</a></div></li>
  56.  
  57.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Movie-Trailer" >Movie Trailer</a></div></li>
  58.  
  59.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Sports-Commentator" >Sports Commentator</a></div></li>
  60.  
  61.         <li><div  class="liStylesidtext"><a href="boys2.asp?id=386&voicetype=Versatile" >Versatile</a></div></li>
  62.  
  63.  
  64.         </ul>         
  65.     </li>
  66.  
  67.  
  68.  
  69.     <li><a href="javascript:void(0)"  id="WorldAccentsidtab">World Accents</a>
  70.         <ul id="ulWorldAccentsid">
  71.  
  72.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Australian" >Australian</a></div></li>
  73.  
  74.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Dutch" >Dutch</a></div></li>
  75.  
  76.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=French" >French</a></div></li>
  77.  
  78.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Mexican" >Mexican</a></div></li>
  79.  
  80.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Oriental" >Oriental</a></div></li>
  81.  
  82.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Russian" >Russian</a></div></li>
  83.  
  84.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=South-African" >South African</a></div></li>
  85.  
  86.         <li><div  class="liWorldAccentsidtext"><a href="boys2.asp?id=386&voicetype=Spanish" >Spanish</a></div></li>
  87.  
  88.  
  89.         </ul>         
  90.     </li>
  91.  
  92. <li><a href="boys2.asp?id=386&voicetype=USA/Mid-Atlantic" id="usatab">USA / Mid Atlantic</a>
  93. </li>
  94.  
  95.  
  96.  
  97.     <li><a href="javascript:void(0)"  id="ForeignLanguagesidtab">Foreign Languages</a>
  98.         <ul id="ulForeignLanguagesid">
  99.  
  100.         <li><div  class="liForeignLanguagesidtext"><a href="boys2.asp?id=386&voicetype=French-Language" >French Language</a></div></li>
  101.  
  102.  
  103.         </ul>         
  104.     </li>
  105.  
  106.  
  107. </ul>
this page can be seen here

http://www.yaketyyak.co.uk/newpages/...&voicetype=All

many thanks
Mar 28 '13 #1
0 1466

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
11
by: gdp | last post by:
hi - hope someone can suggest a way round this see http://www.tidybit.com/public/ this is a stripped down version of a site i am doing. when you mouseover the artist names on the left - the...
0
by: shapper | last post by:
Hi, I have the following layout: http://www.27lamps.com/Beta/Menu/Menu.html It includes a JQuery menu based on SuckerFish: http://alistapart.com/articles/dropdowns The p tag after the menu...
9
by: Anic297 | last post by:
Hello, I'm a newbie in php. I would like to show a popup menu on my website and update the page when the user has changed its selection. I have looked over the Internet but haven't found what I...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
17
by: Nyris | last post by:
I have this code used for the navigation on an HTML page. It's an accordion style dropdown menu. Everything works fine I just need to change it so that the submenuheader class allows it to be a...
0
by: buzzard724 | last post by:
Ul li drop down menu works in FF not quite in IE Thank you for looking at this. The page is generated dynamically by php, js and jquery. The drop down menu ul- reports-li - works fine in FF. In...
0
by: Stuart Hunter | last post by:
Hello, I am currently developing a Joomla site with a YOOtheme template 'Neo' and I'm finding the menu a little too 'quick to appear' on MOUSEOVER and I would really like a delay of around 0.5-1...
1
by: omar999 | last post by:
hi guys i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/ but still having trouble with...
2
by: thehumantest | last post by:
How do I add a mouseover effect to stop the transitions and mouseout to continue? /* ========================================================= // jquery.innerfade.js // Datum: 2008-02-14 //...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.