home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / browser.xpi / bin / res / samples / collapsing.xul < prev    next >
Extensible Markup Language  |  2001-07-09  |  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.     orient="horizontal"
  8.     onload="onWindowLoad()"> 
  9.  
  10.     <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.     </script>
  34.  
  35.     <broadcaster id="ShowSite" sitemode="hideSiteTwo" />
  36.     <observes element="ShowSite" attribute="sitemode" />
  37.     
  38.     <vbox 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.     </vbox>
  42.     <vbox 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.     </vbox>
  46.     
  47. </window>
  48.