Thursday, March 24, 2011

How do I get a usemap working within a firefox XUL document

In my XUL I have the following code fragments:

<map name="KeypadMap">
<area href="javascript:pad('A')" coords="1,1,31,31" shape="rect"/>
</map>
...
<hbox flex="1">
 <image src="./keypad.png" width="32" height="32" useMap="#KeypadMap"/>
</hbox>

The image displays just fine, however, when I mouse over, the cursor does not change to a hand, and clicking does not call the pad function.

Similar code works fine in straight HTML, so there must be some trick to get it working via a Firefox XUL file.

From stackoverflow
  • You'll have to use a namespace to embed HTML inside of XUL. Check this guide.

    Noah : ... this gives me the image which shows up as an expected with properties, but usemap still doe
    Noah : but usemap still does not work.
    Noah : Also requires using id instead of name

0 comments:

Post a Comment