Go Back   Ultimate Web Site Drop Down Menu Forum > UDM4 > Troubleshooting
Register FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Display Modes
Unread 11-06-2008, 03:09 PM
colech colech is offline
Junior Member
Join Date: Nov 2008
Posts: 20
  #1  
Default

I was trying to figure out this question as well.

I suspect is has to do with JS doing an onclick or onmouseup BEFORE the anchor href is followed. So, does anyone know how to follow the link as specified in the tag <a href="/about-us/index.php"> in addition to doing the expanding menu. Here are two things I've tried that have not worked so far...

Code:
<li class="onclick" onmousedown="location.href='/about-us/index.php';">
...
</li>
Code:
<li class="onclick" onclick="location.href='/about-us/index.php';">
...
</li>
Reply With Quote
Unread 11-06-2008, 03:57 PM
colech colech is offline
Junior Member
Join Date: Nov 2008
Posts: 20
  #2  
Default

Wahoo... this page helped me figure out the first half of the problem. Now the items that have submenus are clickable. They don't stay expanded though, so I still need help on that but am looking for the answer now:
http://www.experts-exchange.com/Prog..._22084656.html

NOTE: I am using "udm-x-youarehere.js" instead of "udm-x-snapshot.js" because then if someone manually enters a url in the address bar, the menu will expand properly to right place instead of just saving the last click.

Here is what I gleaned from that and how I got it to work. Notice that I added the onclick to the <a> tag instead of the <li> tag. The reason for using "this.href" instead of "/about-us/index.html" was many people (like myself) have dynamically created menus. It's more difficult to write out the url both in href and onclick, so this way it just copies the value from the href tag to the onclick tag. Now my menu follows the link BUT does not expand for this page. At least we're one step closer.
Code:
<li class="onclick">
  <a href="/about-us/index.php" onclick="document.location.href=this.href; return false;">About Us</a>
</li>

Last edited by colech : 11-06-2008 at 04:53 PM.
Reply With Quote
Unread 11-06-2008, 06:49 PM
colech colech is offline
Junior Member
Join Date: Nov 2008
Posts: 20
  #3  
Default

Whew... I found out how to get the submenu to be displayed when the parent of the submenu is selected when using the expandable menu.
NOTE: To my knowledge, this will only work if you have a dynamic way of adding adding a class to all <li> tags that are currently selected. In this case I chose to use the class "show-since-li-tag-is-active"
Use this CSS (The !important below may or may not be necessary, I was just being safe):

Code:
#udm li.show-since-li-tag-is-active ul {
  position:relative !important;
  display:block !important;
  height:auto !important;
  left:auto !important;
  overflow:visible !important;
  visibility:visible !important;
}
And here is the corresponding HTML menu when at url http://www.domain.com/about-us/

Code:
<ul>
  <li class="onclick">
    <a href="/" onclick="document.location.href=this.href; return false;">Homepage</a>
  </li>
  <li class="onclick show-since-li-tag-is-active">
    <a href="/about-us/" onclick="document.location.href=this.href; return false;">About Us</a>
    <ul>
      <li class="onclick">
        <a href="/about-us/contact-info/" onclick="document.location.href=this.href; return false;">Contact Info</a>
      </li>
    </ul>
  </li>
</ul>
Please let me know if there is a better way to find an active <li> tag potentially through the use of something in udm-x-youarehere.js. I would really like a better way to do this.

This has been verified to work in FF3 and IE7 assuming I didn't do any typos here
Reply With Quote
Unread 11-11-2008, 08:54 PM
Sangui Sangui is offline
Junior Member
Join Date: Oct 2008
Posts: 4
  #4  
Default

colech, thank you so much. That works.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 04:47 PM.


Powered by vBulletin® Version 3.0.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.