Question

Mise à jour

Voici un exemple encore plus simple montrant l'échec (il doit cacher la img après avoir appuyé sur « z » et le montrer après avoir appuyé sur « x »):

Mon 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>

Mon test.css:

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

Mon 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>

Il est pas montrer de retour après caché, une idée de comment résoudre ce problème? Est-ce un bug de XULRunner? Je suis en avec xulrunnet 1.9.2.12.

Était-ce utile?

La solution

Il était un problème avec Xulrunner 9.0.2.12, il fonctionne bien avec 9.0.2.10.

Autres conseils

Utilisation vbox.setAttribute ( "caché", "true"); et vbox.removeAttribute ( "caché");

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top