I came across a time I needed to open a different element then a standard popup menu when clicking the dropdown selector on a toolbar button. I wanted to open a panel instead. To open a different element and hide the popup you can do something similar to this:
<toolbarbutton type=”menu-button”>
<menupopup onpopupshowing=”OpenOtherFunction();event.stopPropagation();return false;” />
</toolbarbutton>
<menupopup onpopupshowing=”OpenOtherFunction();event.stopPropagation();return false;” />
</toolbarbutton>
Update: You can do this much more efficiently using XBL Bindings. I highly recommend reading up on them.
Where I learned it: While working on the Read It Later Firefox Extension
Comments
Leave a Reply