main.xul
<?xml version="1.0"?>
<?xml-stylesheet href="main.css" type="text/css"?>
<window id="main" class="MainClass" title="MY TEST" width="640" height="480" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<listbox id="mainList" flex="1" class="MainListbox">
<listitem label="Twitter"/>
<listitem label="YouTube" id="youtubeID" class="YoutubeClass" oncommand="document.getElementById('youtubeID').startYoutube()"/>
</listbox>
</window>
main.css
.YoutubeClass {
-moz-binding: url("main.xml#youtubeStarter");
}
main.xml
<?xml version="1.0"?>
<bindings xmlns="h开发者_C百科ttp://www.mozilla.org/xbl">
<binding id="youtubeStarter">
<!-- empty -->
</binding>
</bindings>
If I delete the -moz-binding: url('main.xml#youtubeStarter');
from the CSS, the Youtube item shows up.. Any idea why with this line the Youtube item hides?
Got it: when you add a binding (with -moz-binding in css) it will override the content of that component with the content specified in the tag of the binding. If you do not have a tag (my case) you will have no content.
精彩评论