Team:NCTU Formosa/source/head

From 2013.igem.org

(Difference between revisions)
Line 22: Line 22:
     $(window).resize(function() {
     $(window).resize(function() {
         adjustStyle($(this).width());
         adjustStyle($(this).width());
-
    });
 
-
    $(document).ready(function() {
 
-
 
-
        //attach some code to the scroll event of the window object
 
-
        //or whatever element(s) see http://docs.jquery.com/Selectors
 
-
        $(window).scroll(function () {
 
-
              var height = $('body').height();
 
-
              var scrollTop = $('body').scrollTop();
 
-
              var opacity = 1;
 
-
 
-
              // do some math here, by placing some condition or formula
 
-
              if(scrollTop > 400) {
 
-
                  opacity = 0.5;
 
-
              }
 
-
 
-
              //set the opacity of div id="someDivId"
 
-
              $('#top-section').css('opacity', opacity);
 
-
        });
 
     });
     });
var lastId,
var lastId,

Revision as of 12:57, 30 August 2013