开发者

Why when I add the CSS file my list gets rid of "YouTube" item?

开发者 https://www.devze.com 2023-01-15 10:22 出处:网络
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=\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号