Domanda

Aggiornamento

Ecco un esempio ancora più semplice che mostra il fallimento (dovrebbe nascondere l'img dopo stampa "z" e mostrarlo dopo premere "x"):

La mia test.xul:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet href="chrome://test/content/test.css" type="text/css"?>

<window id="desktop" width="640" height="480"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <image id="img" src="image.png" flex="1"/>

</window>

La mia test.css:

#desktop { -moz-binding: url("chrome://test/content/test.xml#desktop"); }

La mia Test.xml:

<?xml version="1.0"?>

<bindings xmlns="http://www.mozilla.org/xbl"
         xmlns:xbl="http://www.mozilla.org/xbl"
         xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <!-- Desktop binding & Key handlers -->
    <binding id="desktop">
        <handlers>
            <handler event="keypress" key="Z" >
                <![CDATA[
                    var img = getElementById("img");
                    if(img)
                        img.hidden = true;
                ]]>
            </handler>
            <handler event="keypress" key="X" >
                <![CDATA[
                    var img = getElementById("img");
                    if(img)
                        img.hidden = false;
                ]]>
            </handler>
        </handlers>
    </binding>

</bindings>

Non è mostrando indietro dopo nascosto, qualche idea di come risolvere il problema? Si tratta di un bug xulrunner? Io corro con xulrunnet 1.9.2.12.

È stato utile?

Soluzione

E 'stato un problema con Xulrunner 9.0.2.12, funziona bene con 9.0.2.10.

Altri suggerimenti

Usa vbox.setAttribute ( "nascosta", "true"); e vbox.removeAttribute ( "nascosta");

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top