Team:Alberta/application.js

From 2010.igem.org

(Difference between revisions)
Line 2: Line 2:
$(document).ready(function(){
$(document).ready(function(){
-
   // hide the igem toolbar
+
   // show the drop down list on hover
-
   //$('#top-section').css('marginTop',-83).addClass("slid-up");
+
   $('li.headlink').hover(
-
 
+
    function() { $('ul', this).css('display', 'block'); },
-
  // append a button for sliding down the igem toolbar
+
    function() { $('ul', this).css('display', 'none'); });
-
  //$("#menubar").append(  
+
-
  //  '<div id="show-toolbar-btn">' +
+
-
  //  '<a href="#" title="Slide down the IGEM toolbar.">' +
+
-
  //'Slide down</a></div>' );
+
-
 
+
-
  $("#show-toolbar-btn").click( function(){  
+
-
    var top = $('#top-section');
+
-
    // 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),
+
-
    }, 1500 );
+
-
    return false;
+
   });
   });
});
});

Revision as of 04:33, 22 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).css('display', 'block'); },
   function() { $('ul', this).css('display', 'none'); });
 });

});