With HTML Tags in Description Text, OnClick event don't fire

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
apressato
Beginner
Beginner
Posts: 1
Joined: Tue Jun 11, 2002 4:53 pm
Location: Italy

With HTML Tags in Description Text, OnClick event don't fire

Post by apressato »

Hi,
I have noticed that if you put an HTML block like this into the Description Text of a Menu Item, the OnClick event doesen't fire.

Code: Select all

<div class=MyMenuItem>
.
.
.
<img border=0 src=WhoAmI.gif width=24 height=24>
.
.
.
Description Text
</div>
More precisely, it fire only if you click on the image but not on the text.

So I have added the following code in function hl() (mmenu.js):

Code: Select all

// AP | 20020613: Added for Custom Object in Text field
if(arg[0].indexOf("<div")>=0)
  {
    if(menu[11]&&ns6)ns6hif=1
    ipos=arg[0].indexOf("<div");
    arg[0]=arg[0].substr(0,ipos+4)+" onclick=\"gmobj('el"+el+"').click()\"  id=tbl"+el+" "+ arg[0].substr(ipos+5,900);
  }
just after

Code: Select all

  if(arg[0].indexOf("<img")>=0)
    {
      if(menu[11]&&ns6)ns6hif=1
      ipos=arg[0].indexOf("<img");
      arg[0]=arg[0].substr(0,ipos+4)+" onclick=\"gmobj('el"+el+"').click()\" id=im"+el+" "+ arg[0].substr(ipos+5,900);
   }
and work very fine ! :D
Post Reply