» Forums
» DynarchMenu forum
» Support
» javascript actions on nodes
javascript actions on nodes
2008/03/11 14:28
Viewed 1402 times
Replies: 1/1

Hi,

I'm trying to get nodes to do something other than just open submenus. Is this possible?

For example, in the example below:
<code>
<ul id="menu">
<li>Item 1</li>
<li>Item 2</li>
<li onclick="alert('test');">
Item 3
<ul >
<li>SubItem 3.1</li>
<li>SubItem 3.2</li>
</ul>
</li>
</ul>
</code>

Clicking on "Link 3" (or rolling over it for electric menu) will open the submenu, but I also want it to do something else.. calling my own handler. However, adding onclick to the <li> does nothing.

Does anyone have a notion of how I might do this?

The reason I'm trying to do this is so that I can transmit the "current" menuitem id to a script that allows the menu to be edited. Currently the script only works for non-node items!

Thanks,
Noel da Costa

Re: javascript actions on nodes
2008/06/07 09:01
Viewed 615 times
Replies: 0/0

<head>
function myfunction() {
alert("Clicking me will call an alert box");
}
</head>

<code>
<ul id="menu">
<li>Item 1</li>
<li>Item 2</li>
<li><a href=javascript:myfunction()>Item 3</a>
<ul >
<li>SubItem 3.1</li>
<li>SubItem 3.2</li>
</ul>
</li>
</ul>
</code>

This is most likely what you are looking for?

last
Google