home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-mac-0.9.sea.hqx / mozilla-mac-0.9 / res / samples / collapsing.xul < prev    next >
Extensible Markup Language  |  2001-05-05  |  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.     <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.     <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.