Fixed a problem with the Javascript pager.
authordtrg <none@none>
Tue, 22 Feb 2005 23:39:50 +0000 (23:39 +0000)
committerdtrg <none@none>
Tue, 22 Feb 2005 23:39:50 +0000 (23:39 +0000)
index.html
pager.js
site.css

index 54bfd33..e4fee01 100644 (file)
   <link type="text/css" href="site.css" rel="stylesheet">
        <script type="text/javascript" src="pager.js"></script>
 </head>
-<body>
+<body onload="showpage(page)">
 <div class="title">
 <h1>The
 Amsterdam Compiler Kit</h1>
 </div>
 <div class="contents">
-<h3><a href="#home" onclick="showpage('home')">Home</a></h3>
-<h3><a href="#introduction" onclick="showpage('introduction')">Introduction</a></h3>
-<h3><a href="#documentation" onclick="showpage('documentation')">Documentation</a></h3>
-<h3><a href="#installation" onclick="showpage('installation')">Installation</a></h3>
+<h3><a href="#home" onclick="showpage('home'); return false">Home</a></h3>
+<h3><a href="#introduction" onclick="showpage('introduction'); return false">Introduction</a></h3>
+<h3><a href="#documentation" onclick="showpage('documentation'); return false">Documentation</a></h3>
+<h3><a href="#installation" onclick="showpage('installation'); return false">Installation</a></h3>
 <p class="c"><a href="http://sourceforge.net/projects/tack"><img
  src="http://sourceforge.net/sflogo.php?group_id=108104&amp;type=1"
  alt="SourceForge.net Logo" border="0" height="31" width="88"></a></p>
@@ -34,7 +34,7 @@ alt="Valid HTML 4.01!" height="31" width="88"></a>
 </div>
 <div class="body">
 
-<div id="home"><h2><a name="home">Home</a></h2>
+<div class="page" id="home"><h2><a name="home">Home</a></h2>
 <h3>2005-02-14</h3>
 <p>Initial version of this web page set up.</p>
 <h3>2005-02-11</h3>
index a461d1c..ad9a5f7 100644 (file)
--- a/pager.js
+++ b/pager.js
 
 document.write("<style type='text/css'>.page { display: none }</style>");
 
-var page = "home";
+var page = function() {
+       var s = document.location.toString();
+       var i = s.indexOf("#");
+       if (i == -1)
+               return "home";
+       return s.substr(i+1);
+}()
+
 function showpage(pagename)
 {
        /* Hide old page. */
@@ -27,6 +34,9 @@ function showpage(pagename)
 
 /* Revision history
  * $Log$
+ * Revision 1.2  2005/02/14 23:51:25  dtrg
+ * Initial version.
+ *
  * Revision 1.1  2005/02/14 23:39:07  dtrg
  * Initial version.
  */
index 764d2e4..9fa7955 100644 (file)
--- a/site.css
+++ b/site.css
@@ -85,7 +85,7 @@ BODY {
        margin: 0;
 }
 
-.body > A {
+.anchor {
        position: absolute;
        top: 0;
 }
@@ -105,5 +105,8 @@ BODY {
 
 /* Revision history
  * $Log$
+ * Revision 1.2  2005/02/14 23:51:25  dtrg
+ * Initial version.
+ *
  *
  * vim: set ts=2 sw=2: */