home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 December / PCWorld_2000-12_cd.bin / Komunikace / mozilla / mozilla-win32-M18-mathml-svg-xslt.exe / res / samples / collapsing.xul < prev    next >
Extensible Markup Language  |  2000-06-15  |  2KB  |  48 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="collapsing.css" type="text/css"?> 
  3.  
  4. <window xmlns:html="http://www.w3.org/1999/xhtml"
  5.     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  6.     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  7.     align="horizontal"
  8.     onload="onWindowLoad()"> 
  9.  
  10.     <html:script>
  11.     function onWindowLoad() {
  12.         verifyControls();
  13.     }
  14.     function verifyControls() {
  15.         var siteOne = window.frames["SiteOne"];
  16.         var siteTwo = window.frames["SiteTwo"];
  17.         if(siteOne==null)
  18.             window.alert("Our SiteOne Frame isn't in the DOM!");
  19.         if(siteTwo == null)
  20.             window.alert("Our SiteTwo Frame isn't in the DOM!");
  21.     }
  22.     function cmdHideSiteOne(){
  23.         verifyControls();
  24.         window.document.getElementById("ShowSite").setAttribute("sitemode", "hideSiteOne");        
  25.         verifyControls();
  26.     }
  27.  
  28.     function cmdHideSiteTwo() {
  29.         verifyControls();
  30.         window.document.getElementById("ShowSite").setAttribute("sitemode", "hideSiteTwo");
  31.         verifyControls();
  32.     }
  33.     </html:script>
  34.  
  35.     <broadcaster id="ShowSite" sitemode="hideSiteTwo" />
  36.     <observes element="ShowSite" attribute="sitemode" />
  37.     
  38.     <box align="vertical" id="SiteOneBox" flex="1">
  39.         <html:iframe flex="1" name="SiteOne" src="http://www.mozilla.org/xpfe/xptoolkit"/>
  40.         <html:input type="BUTTON" value="Show Boxes Documentation" onclick="cmdHideSiteOne()"/>
  41.     </box>
  42.     <box align="vertical" id="SiteTwoBox" flex="1">
  43.         <html:iframe flex="1" name="SiteTwo" src="http://www.mozilla.org/xpfe/xptoolkit/boxes.html"/>
  44.         <html:input type="BUTTON" value="Show XPFE Documentation" onclick="cmdHideSiteTwo()"/>
  45.     </box>
  46.     
  47. </window>
  48.