Team:TU Delft/test

From 2010.igem.org

(Difference between revisions)
Line 26: Line 26:
         </style>
         </style>
-
        <div id="panel_mask">
 
-
        <!-- to load pages that are not in the main sliding pages -->
 
-
        <div id="subpage_panel" style="display:hidden;"></div>
 
         <div id="panel">
         <div id="panel">
         <!-- CONTENT STARTS HERE /-->
         <!-- CONTENT STARTS HERE /-->
-
 
+
             {{:Team:TU_Delft/pages/{{{contentpage|home}}} }}
-
             <div id="page_home" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/home}}<html>
+
-
            </div>
+
-
           
+
-
            <div id="page_blog" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/blog}}<html>
+
-
            </div>
+
-
 
+
-
            <div id="page_competition" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/competition}}<html>
+
-
            </div>
+
-
 
+
-
            <div id="page_background" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/background}}<html>
+
-
            </div>
+
-
 
+
-
            <div id="page_project" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/project}}<html>
+
-
            </div>
+
-
 
+
-
            <div id="page_education" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/education}}<html>
+
-
            </div>
+
-
           
+
-
            <div id="page_sponsors" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/sponsors}}<html>
+
-
            </div>
+
-
           
+
-
            <div id="page_press" class="page_panel">
+
-
            </html>{{:Team:TU_Delft/pages/press}}<html>
+
-
            </div>
+
         <!-- CONTENT ENDS HERE /-->
         <!-- CONTENT ENDS HERE /-->
-
        </div>
 
         </div>
         </div>
Line 139: Line 104:
       if(pgHeight > maxHeight) maxHeight = pgHeight;
       if(pgHeight > maxHeight) maxHeight = pgHeight;
     }
     }
-
 
-
    $(".page_panel").height(maxHeight).each(function() { rewriteLinks(this); });
 
-
  // $('#panel_mask').height(maxHeight);
 
-
 
-
    //Calculate the total width - sum of all sub-panels width 
 
-
    //Width is generated according to the width of #mask * total of sub-panels
 
-
    $('#panel').width(parseInt($('#panel_mask').width() * $('#panel div').length));
 
-
 
-
    //Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
 
-
    $('#panel div').width($('#panel_mask').width());
 
   // instead of button click handler, all actions pass through the address bar so history works too
   // instead of button click handler, all actions pass through the address bar so history works too
Line 157: Line 112:
       $(".menu_button_" + activePage).removeClass("menu_button_" + activePage + "_sel");
       $(".menu_button_" + activePage).removeClass("menu_button_" + activePage + "_sel");
       activePage = page;
       activePage = page;
 +
 +
      $.get(url, function(data) {
 +
        $("#subpage_panel").html(data).show(200);
 +
        rewriteLinks($("#subpage_panel"));
 +
      });
       if($.inArray(page, pages) < 0) {
       if($.inArray(page, pages) < 0) {
Line 166: Line 126:
         isMenuPage = true;
         isMenuPage = true;
-
        $.get(url, function(data) {
 
-
          $("#subpage_panel").html(data).show(200);
 
-
          rewriteLinks($("#subpage_panel"));
 
-
        });
 
       } else {
       } else {
         if (isMenuPage) {
         if (isMenuPage) {
Line 180: Line 136:
         // remove old page if any, show tab content
         // remove old page if any, show tab content
         $(".menu_button_" + activePage).addClass("menu_button_" + activePage + "_sel");
         $(".menu_button_" + activePage).addClass("menu_button_" + activePage + "_sel");
-
 
-
        //Get the height of the sub-panel 
 
-
        var panelheight = $("#page_" + page).height();
 
-
 
-
        //Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor 
 
-
        $('#panel_mask').scrollTo("#page_" + page, 400);
 
-
 
-
        //Resize the height
 
-
//        $('#panel_mask').animate({ 'height': panelheight }, { duration: 50 });
 
       }
       }
   });
   });

Revision as of 15:07, 16 June 2010


 
{{:Team:TU_Delft/pages/{{{contentpage|home}}} }}