Team:Alberta/application.js

From 2010.igem.org

(Difference between revisions)
Line 1: Line 1:
 +
// This file for javascript that we want to include on all pages
 +
alert("testing");
alert("testing");
 +
 +
var slide_down_toolbar_btn = '
 +
 +
$(document).ready(function(){
 +
  // hide the igem toolbar
 +
  $('#top-section').hide().addClass("slid-up");
 +
  // append a button for sliding down the igem toolbar
 +
  $("#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),
 +
    }, 3000 );
 +
 +
  });
 +
 +
});

Revision as of 01:34, 20 August 2010

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

alert("testing");

var slide_down_toolbar_btn = '

$(document).ready(function(){

 // hide the igem toolbar
 $('#top-section').hide().addClass("slid-up");
 // append a button for sliding down the igem toolbar
 $("#menubar").append( 
'
' +
    '<a href="#" title="Slide down the IGEM toolbar.">' +
'Slide down</a>
' );
 $("#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),
   }, 3000 );
 });

});