fixed linking to anchor
authorDylan Lloyd <dylan@psu.edu>
Mon, 20 Dec 2010 17:21:55 +0000 (12:21 -0500)
committerDylan Lloyd <dylan@psu.edu>
Mon, 20 Dec 2010 17:21:55 +0000 (12:21 -0500)
includes/tabs.js
index.php

index 7c7f269..a3c4ded 100644 (file)
@@ -1,5 +1,9 @@
 $(document).ready(function() {
        $(".tabs").hide();
+       var divs = document.getElementsByTagName('div');
+       if(document.location.hash){
+               $(document.location.hash + '_').show();
+       }
        var i = 0;
        $("ul.portfolio li.project a.exhibit").click(function() {
                i++;
@@ -7,16 +11,14 @@ $(document).ready(function() {
                $("ul.portfolio li").removeClass("active");
                $(this).addClass("active_project");
 
-               var activeTab = $(this).attr("href");
+               var activeTab = $(this).attr("href") + '_';
                if (i==1)
                        $(activeTab).show("slide", 400);
                else
                        $(activeTab).show("puff", 600);
                $(activeTab).addClass("active_tab");
-               return false;
        });
        $('#showdivs').click(function() {
-               var divs = document.getElementsByTagName('div');
                for(i=0;i<divs.length;i++){
                        divs[i].className += (" shownDiv");
                }
index 2e5246c..2c86bfb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -31,7 +31,7 @@
 
     <div id="content">
       <div id="exhibit">
-        <div class="tabs" id="repthis">
+        <div class="tabs" id="repthis_">
           <span class="reprap_entry-title">3D printing is a form of
           additive manufacturing technology where a three
           dimensional object is created by successive layers of
 </span>
         </div>
 
-        <div class="tabs" id="youtube_backup">
+        <div class="tabs" id="youtube_backup_">
           <span class="youtube_backup-entry-title"><a href=
           "https://github.com/nospampleasemam/youtube_backup">youtube_backup</a></span>
+                 <br><br>
                  <span class="youtube_backup-entry">
                  <br>
                  backs up all the <a href="http://youtube.com">youtube</a> videos in a users favorites list.<br><br>
@@ -60,7 +61,7 @@
                  </span>
         </div>
 
-        <div class="tabs" id="peepshow"> 
+        <div class="tabs" id="peepshow_"> 
           <h3><i><a href=
           "foxy-addons/peepshow">foxy-addons/</a></i></h3>
 
@@ -72,7 +73,7 @@
 
        here's the <a href="http://github.com/nospampleasemam/peepshow/">repo</a> for the source code.</span>
         </div>
-       <div class="tabs" id="drawcss">
+       <div class="tabs" id="drawcss_">
        <span class="drawcss_entry"><a href="drawcss">drawcss</a><br><br>
        writing markup for website wireframes always seemed silly.<br><br>
        this is a tool to draw them (it's not done).<br><br>
@@ -81,7 +82,7 @@
        </span>
        </div>
 
-        <div class="tabs" id="readoo">
+        <div class="tabs" id="readoo_">
        <span class="readoo_entry"><a href="readoo">readoo</a> helps you find search keywords to target.<br><br>
        it reads your IIS logs, and finds successful keywords worth focusing on.<br><br>
        it's not done yet! here's the <a href="github.com/nospampleasemam/READOO">source code</a>.</span>