| Re: hmenu and prototype ¶ | |
| I am trying to use Prototype's Event.Observe(menu_item_link,'click',... but it never seems to fire. If I hard code a onclick="" in the <a> tag, it works. Is there an incompatibility between the two? Not sure if it's an incompatibility; however, it can't work because the HTML that you write in the <ul> is replaced by totally new elements. For instance, a table item is a <tr> element in a table, and it has a <td> for the icon, one for the label and one for the right arrow (if it has a popup submenu)—so things are more complex. So I gather you generally want to be able to add an event handler when an item is clicked? If so, it could help you if you can get a reference to the item's <tr>? Also, I tried to scan the source, but when I went back to the email with the package in it, I only have the source that is compressed, not the commented version . I'd thought that there were both, one for me and one to use still compressed if I so chose. In the “library” version... | |
| Re[2]: hmenu and prototype ¶ | |
| > So I gather you generally want to be able to add an event handler when an item is clicked? If so, it could help you if you can get a reference to the item's <tr>? Well, the item is a link like this : <a id=myname>Menu Item</a> And later I want to attach an event to its onclick: Event.Observe('myname','click',myeventhandler) The <a> tag remains after you put a table around it, as far as I can tell when I use a tool to look at the rendered source code... | |
| last |
| Re[3]: hmenu and prototype ¶ | |
| The <a> tag does not get moved into the menus table structure. My mistake. The solution is to create a function that fires an event back to the hidden <a> link. All works after that. :) | |
| last |
| Re[2]: hmenu and prototype ¶ | |
| > In the “library” version... Did you change this around at some point? I had the source with comments at one time, and I thought we got the most expensive version at the time... | |
| last |














