JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

onClick support in 2.9.4?

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu
Author Message
dligon



Joined: 19 Sep 2007
Posts: 1
Location: USA

PostPosted: Wed Sep 19, 2007 7:21 pm    Post subject: onClick support in 2.9.4? Reply with quote

Our site currently uses Coolmenupro Version 2.4.8, and we would like to upgrade to version 2.9.4 for IE7 compatibility, but cannot seem to get the onClick event to work in the new version.

Using the sample code provided in COOLjsMenu Professional\2.9.4\Samples\Commented\Popup menus\sample.php.html, we tried to change the following event from onmouseover to onClick and it does not work:

CHANGED FROM:
<p><a href="sample.php.html#" onmouseover="CMenuPopUp('test', event)">Popup in mouse position</a></p>

CHANGED TO:
<p><a href="sample.php.html#" onClick="CMenuPopUp('test', event)">Popup in mouse position</a></p>

Can you tell us whether the onClick event is still supported?
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Thu Sep 27, 2007 11:52 am    Post subject: Reply with quote

You should cancel event bubbling in your onclick event handler:
Code:
if (event.stopPropagation) {
    event.stopPropagation();
} else {
    event.cancelBubbling = true;
}
Back to top
PRDG1



Joined: 22 Jan 2008
Posts: 1
Location: Dallas, TX

PostPosted: Tue Jan 22, 2008 3:45 pm    Post subject: Along the same lines... Reply with quote

Forgive me because javascript is not my strong suite. I've used one of the graphical pro menus for a project that I'm working on. A developer emailed me and said that he's trying to "call one javascript method onclick" within one of the menu dropdowns. Is what this user experienced the same issue he is referencing? What needs to be done? Here is the sample code snippet he sent me...

{code:"Quick LT", size:[20,75]}, this is the place he needs to insert a CallLineTestFunction{}

I'm assuming the reason he can't get it to work is because of the onClick issue.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Mar 05, 2008 9:52 am    Post subject: Reply with quote

No, these issues are unrelated. Here is a simple answer to your message:
Code:
{code:"Quick LT", size:[20,75], url:'javascript:CallLineTestFunction{}'},

More sophisticated approach is also possible.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu All times are GMT
Page 1 of 1