943,099 Members | Top Members by Rank

Ad:
Mar 10th, 2010
0

drop down menu not working in IE6

Expand Post »
its working in Firefox and IE 8
HTML and CSS Syntax (Toggle Plain Text)
  1. html code
  2.  
  3. <ul id="menu">
  4. <li><a href="#"
  5. onmouseover="mopen('m1')"
  6. onmouseout="mclosetime()">About GMU</a>
  7. <div id="m1"
  8. onmouseover="mcancelclosetime()"
  9. onmouseout="mclosetime()">
  10. <a href="#">History & Mission</a>
  11. <a href="#">Office of the President</a>
  12. <a href="#">Office of the Provost </a>
  13. <a href="#">Administration</a>
  14. <a href="#">News & Publications</a>
  15. <a href="#">Visitor Information</a>
  16. <a href="#">Facts & Statistics</a>
  17. <a href="#">Social Media</a>
  18. <a href="#">Employment</a> </div>
  19. </li>
  20. <li><a href="#"
  21. onmouseover="mopen('m2')"
  22. onmouseout="mclosetime()">Admissions</a>
  23. <div id="m2"
  24. onmouseover="mcancelclosetime()"
  25. onmouseout="mclosetime()"> <a href="#">Apply Now</a> <a href="#">Request for material</a> <a href="#">Admission Process</a> <a href="#">Fees Details</a> <a href="#">Undergraduate</a> <a href="#">Postgraduate</a> <a href="#">By College</a> <a href="#">Visitor information</a> <a href="#">Parent information</a> </div>
  26. </li>
  27. <li><a href="#"
  28. onmouseover="mopen('m3')"
  29. onmouseout="mclosetime()">Colleges & Academics</a>
  30. <div id="m3"
  31. onmouseover="mcancelclosetime()"
  32. onmouseout="mclosetime()"> <a href="#">Colleges</a> <a href="#">Departments</a> <a href="#">Summer Training</a> <a href="#">Clinical Skills lab</a> <a href="#">Online Academic Catalogs</a> <a href="#">Academic calendars</a> <a href="#">Simulation Center</a> <a href="#">Academic Advising</a> </div>
  33. </li>
  34. <li><a href="#"
  35. onmouseover="mopen('m4')"
  36. onmouseout="mclosetime()">Health Care</a>
  37. <div id="m4"
  38. onmouseover="mcancelclosetime()"
  39. onmouseout="mclosetime()"> <a href="#">History & Mission</a> <a href="#">Our Hospitals</a> <a href="#">Services & Features</a> <a href="#">Laboratory</a> <a href="#">Pharmacy</a> </div>
  40. </li>
  41. <li><a href="#"
  42. onmouseover="mopen('m5')"
  43. onmouseout="mclosetime()">Health Communications</a>
  44. <div id="m5"
  45. onmouseover="mcancelclosetime()"
  46. onmouseout="mclosetime()"> <a href="#">CNE Programs</a> <a href="#">Health Magazines</a> <a href="#">Conferences and workshops</a> <a href="#">Sponsorship Details</a> <a href="#">Media Kit</a> </div>
  47. </li>
  48. <li><a href="#"
  49. onmouseover="mopen('m6')"
  50. onmouseout="mclosetime()">Library</a>
  51. <div id="m6"
  52. onmouseover="mcancelclosetime()"
  53. onmouseout="mclosetime()"> <a href="#">Online Catalog</a> <a href="#">Journals</a> <a href="#">Research & Dtabases</a> <a href="#">Links</a> <a href="#">Services</a> <a href="#">Contact Details</a> </div>
  54. </li>
  55. <li><a href="#"
  56. onmouseover="mopen('m7')"
  57. onmouseout="mclosetime()">Research</a>
  58. <div id="m7"
  59. onmouseover="mcancelclosetime()"
  60. onmouseout="mclosetime()"> <a href="#">Mission</a> <a href="#">Objectives</a> <a href="#">Contact Details</a> </div>
  61. </li>
  62. <li><a href="#">Campus life</a></li>
  63. <li><a href="#">Alumni</a></li>
  64. <li><a href="#">My GMU</a></li>
  65. </ul>
  66.  
  67.  
  68.  
  69.  
  70. CSS code
  71.  
  72. #menu
  73. { margin: 0;
  74. padding: 0;
  75. z-index: 1}
  76.  
  77. #menu li
  78. {
  79. margin: 0;
  80. padding: 0;
  81. list-style: none;
  82. float: left;
  83. font-family: sans-serif;
  84. font-size: 11px;
  85. font-weight: bold;
  86.  
  87. }
  88.  
  89. #menu li a
  90. {
  91. display: block;
  92. width: auto;
  93. color: #6A6A6A;
  94. text-align: center;
  95. text-decoration: none;
  96. margin-top: 0;
  97. margin-right: 0px;
  98. margin-bottom: 0;
  99. margin-left: 0;
  100. padding-top: 8px;
  101. padding-right: 15px;
  102. padding-bottom: 2px;
  103. padding-left: 16px;
  104. background-image: url(images/bu_top_bg_gray_bev.jpg);
  105. height: 23px;
  106.  
  107. }
  108.  
  109. #menu li a:hover
  110. {
  111. color: #283A50;
  112. background-image: url(images/bu_top_bg_gray_bev1.jpg);
  113. }
  114.  
  115. #menu div
  116. {
  117. position: absolute;
  118. visibility: hidden;
  119. padding: 0px;
  120. margin-top: 0px;
  121. margin-right: 0px;
  122. margin-bottom: 0px;
  123. margin-left: 0px;
  124. border-top-width: 1px;
  125. border-right-width: 1px;
  126. border-bottom-width: 1px;
  127. border-left-width: 1px;
  128. border-top-style: none;
  129. border-right-style: solid;
  130. border-bottom-style: solid;
  131. border-left-style: solid;
  132. border-top-color: #C4C4C4;
  133. border-right-color: #C4C4C4;
  134. border-bottom-color: #C4C4C4;
  135. border-left-color: #C4C4C4;
  136. background-color: #CECECE;
  137. }
  138.  
  139. #menu div a
  140. {
  141. position: relative;
  142. display: block;
  143. width: auto;
  144. white-space: nowrap;
  145. text-align: left;
  146. text-decoration: none;
  147. background: #ECECEC;
  148. color: #747474;
  149. font-family: sans-serif;
  150. font-size: 11px;
  151. font-weight: normal;
  152. padding-top: 5px;
  153. padding-right: 14px;
  154. padding-bottom: 5px;
  155. padding-left: 14px;
  156. height: 15px;
  157. margin-top: 0;
  158. margin-right: 0;
  159. margin-bottom: 1px;
  160. margin-left: 0;
  161. }
  162.  
  163. #menu div a:hover
  164. { background: #49A3FF;
  165. color: #FFF}
  166.  
  167.  
  168. Javascript:
  169.  
  170. var timeout = 500;
  171. var closetimer = 0;
  172. var ddmenuitem = 0;
  173.  
  174. // open hidden layer
  175. function mopen(id)
  176. {
  177. // cancel close timer
  178. mcancelclosetime();
  179.  
  180. // close old layer
  181. if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
  182.  
  183. // get new layer and show it
  184. ddmenuitem = document.getElementById(id);
  185. ddmenuitem.style.visibility = 'visible';
  186.  
  187. }
  188. // close showed layer
  189. function mclose()
  190. {
  191. if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
  192. }
  193.  
  194. // go close timer
  195. function mclosetime()
  196. {
  197. closetimer = window.setTimeout(mclose, timeout);
  198. }
  199.  
  200. // cancel close timer
  201. function mcancelclosetime()
  202. {
  203. if(closetimer)
  204. {
  205. window.clearTimeout(closetimer);
  206. closetimer = null;
  207. }
  208. }
  209.  
  210. // close layer when click-out
  211. document.onclick = mclose;
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shaikanwar14 is offline Offline
1 posts
since Mar 2010
Mar 10th, 2010
0
Re: drop down menu not working in IE6
Suggest you go read up on the son of suckerfish way of making menus. Your way will fail with javascript disabled and requires you to write lots of code for each link.

Suckerfish is sooooo much easier to use. just add the twelve line script via an external javascript file to the head, and make unordered lists of your dropdown menu. so easy to read and find errors in as well.
www.htmldog.com is where you'll find it.
Last edited by drjohn; Mar 10th, 2010 at 12:30 pm.
Reputation Points: 76
Solved Threads: 77
Posting Pro in Training
drjohn is offline Offline
422 posts
since Mar 2010
Dec 8th, 2010
0
Re: drop down menu not working in IE6
You only provided a partial page coding so I will have to assume you have a problem in your <head> ....</head> tags. The reason I say this is because you are using HTML and CSS, IE6 will not render a lot of CSS correctly unless you have included the correct <DOCTYPE> for your document.

Make sure this statement appears at the very top of your document.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Michael
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Armadillo is offline Offline
8 posts
since Oct 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: <p> Tag on Tables
Next Thread in HTML and CSS Forum Timeline: Webpage not displaying correctly





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC