add lesson life cycle stage indicator
[rnaseq-cwl-training.git] / assets / js / lesson.js
index 185da920220429f734256180b9d7baf41323d45e..333dee8c1b5508234a98cbdee40eae4532097d73 100644 (file)
@@ -26,3 +26,31 @@ function google_search() {
   var domain = $("meta[name=search-domain]").attr("value");
   window.open("https://www.google.com/search?q=" + query + "+site:" + domain);
 }
+
+// function to shrink the life cycle bar when scrolling
+$(function(){
+    $('#life-cycle').data('size','big');
+});
+
+$(window).scroll(function(){
+    if($(document).scrollTop() > 0)
+    {
+        if($('#life-cycle').data('size') == 'big')
+        {
+            $('#life-cycle').data('size','small');
+            $('#life-cycle').stop().animate({
+                padding: '5px'
+            },100);
+        }
+    }
+    else
+    {
+        if($('#life-cycle').data('size') == 'small')
+        {
+            $('#life-cycle').data('size','big');
+            $('#life-cycle').stop().animate({
+                padding: '15px'
+            },100);
+        }
+    }
+});