hmenu and prototype
2006/05/04 02:57
Viewed 4593 times
Replies: 1/4

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?

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.

Re: hmenu and prototype
2006/05/04 10:33
Viewed 6239 times
Replies: 2/3

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...

last
Re[2]: hmenu and prototype
2006/05/04 23:00
Viewed 7675 times
Replies: 1/1

> 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[2]: hmenu and prototype
2006/05/04 23:01
Viewed 8333 times
Replies: 0/0

> 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
Google