944,198 Members | Top Members by Rank

Ad:
Nov 9th, 2007
0

ClamShell Menu Not Working in Foxfire

Expand Post »
Hi,

This clamshell menu code works fine in IE and Safari, but level 3 does not work in Firefox. When I click on 3-Level Menu - Level 2, the menu closes. Clicking on 3-Level Menu - Level 1 again shows the level 3 items were indeed opened. The 2-level menu works fine.

Does anyone know why this does not work in Firefox? Thanks!

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <HTML>
  2. <HEAD>
  3. <script>
  4. function toggleMenu(objectID)
  5. {
  6. var objectblock = document.getElementById(objectID).style;
  7.  
  8. if (objectblock.display == 'block')
  9. {
  10. objectblock.display = 'none';
  11. window.event.cancelBubble = true;
  12. window.event.returnValue = false;
  13. }
  14. else
  15. {
  16. objectblock.display = 'block';
  17. window.event.cancelBubble = true;
  18. window.event.returnValue = false;
  19. }
  20. }
  21. </script>
  22. </HEAD>
  23.  
  24. <BODY>
  25. <div onClick="toggleMenu('3level1')">3-Level Menu - Level 1
  26. <div id='3level1' style='margin-left: 10%; display: none'>
  27. <div onClick="toggleMenu('3level2')">3-Level Menu - Level 2 (clicking here not working in FF)
  28. <div id='3level2' style='margin-left: 10%; display: none'>
  29. <div onclick="event.cancelBubble = 'true'">Level 3 - anchor to desired page here</div>
  30. <div onclick="event.cancelBubble = 'true'">Level 3 - another anchor here</div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <div onClick="toggleMenu('2level1')">2-Level Menu - Level 1
  36. <div id='2level1' style='margin-left: 10%; display: none'>
  37. <div onclick="event.cancelBubble = 'true'">Level 2 - anchor to desired page here (works in FF)</div>
  38. </div>
  39. </div>
  40. </BODY>
  41. </HTML>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
movcol is offline Offline
1 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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 JavaScript / DHTML / AJAX Forum Timeline: drop down quantity box to update price
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: preloading image (white page between) problem





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


Follow us on Twitter


© 2011 DaniWeb® LLC