Team:Alberta/application.js

From 2010.igem.org

(Difference between revisions)
 
(26 intermediate revisions not shown)
Line 1: Line 1:
// This file for javascript that we want to include on all pages
// This file for javascript that we want to include on all pages
-
alert("testing");
+
$(document).ready(function(){
 +
  // show the drop down list on hover
 +
  $('li.headlink').hover(
 +
    /*function() { $('ul', this).show(); },
 +
    function() { $('ul', this).hide(); }*/
 +
    function() { $('ul', this).css('display', 'table') },
 +
    function() { $('ul', this).css('display', 'none') }
 +
  );
-
var slide_down_toolbar_btn = '
+
  $('.achieve-link').click(function(){
 +
    document.location="https://2010.igem.org/Team:Alberta/Achievements";
 +
  });
-
$(document).ready(function(){
+
  $('.software-link').click(function(){
-
  // hide the igem toolbar
+
    document.location="https://2010.igem.org/Team:Alberta/Software";
-
   $('#top-section').hide().addClass("slid-up");
+
  });
-
   // append a button for sliding down the igem toolbar
+
 
-
   $("#menubar").append(  
+
   $('.kit-link').click(function(){
-
    '<div id="show-toolbar-btn">' +
+
    document.location="https://2010.igem.org/Team:Alberta/Kit";
-
    '<a href="#" title="Slide down the IGEM toolbar.">' +
+
   });
-
    'Slide down</a></div>' );
+
 
 +
   $('.biobytes-link').click(function(){
 +
    document.location="https://2010.igem.org/Team:Alberta/biobyte2";
 +
  });
-
   $("#show-toolbar-btn").click( function(){  
+
   $('.genomikon-link').click(function(){
-
     var top = $('#top-section');
+
     document.location="http://www.genomikon.ca";
-
    // amount to move the top
+
  });
-
    var distance = '83';
+
-
    if( top.hasClass( "slid-up" ) ){
+
-
      top.removeClass( "slid-up" );
+
-
      var direction = '+=';
+
-
    }
+
-
    else {
+
-
      top.addClass('slid-up');
+
-
      var direction = '-=';
+
-
    }
+
-
    top.animate({
+
-
        marginTop: (direction + distance),
+
-
    }, 3000 );
+
 +
$('.tour-link').click(function(){
 +
    document.location="https://2010.igem.org/Team:Alberta/Tour/start";
   });
   });
});
});

Latest revision as of 00:57, 27 October 2010

// This file for javascript that we want to include on all pages

$(document).ready(function(){

 // show the drop down list on hover
 $('li.headlink').hover(
   /*function() { $('ul', this).show(); },
   function() { $('ul', this).hide(); }*/
   function() { $('ul', this).css('display', 'table') },
   function() { $('ul', this).css('display', 'none') }
 );
 $('.achieve-link').click(function(){
   document.location="https://2010.igem.org/Team:Alberta/Achievements";
 });
 $('.software-link').click(function(){
   document.location="https://2010.igem.org/Team:Alberta/Software";
 });
 $('.kit-link').click(function(){
   document.location="https://2010.igem.org/Team:Alberta/Kit";
 });
 $('.biobytes-link').click(function(){
   document.location="https://2010.igem.org/Team:Alberta/biobyte2";
 });
 $('.genomikon-link').click(function(){
   document.location="http://www.genomikon.ca";
 });

$('.tour-link').click(function(){

   document.location="https://2010.igem.org/Team:Alberta/Tour/start";
 });

});