Team:NCTU Formosa/source/head

From 2013.igem.org

(Difference between revisions)
Line 33: Line 33:
return false;
return false;
   });*/
   });*/
 +
$.fn.followTo = function (pos) {
 +
    var $this = this,
 +
        $window = $(window);
 +
 +
    $window.scroll(function (e) {
 +
        if ($window.scrollTop() < pos) {
 +
            $this.css({
 +
                position: 'absolute',
 +
                top: pos
 +
            });
 +
        } else {
 +
            $this.css({
 +
                position: 'fixed',
 +
                top: 0
 +
            });
 +
        }
 +
    });
 +
};
 +
$('#toc').followTo(214);
});
});
</script>
</script>

Revision as of 17:59, 29 August 2013