Team:HIT-Harbin/js/main.js

From 2014.igem.org

(Difference between revisions)
Line 20: Line 20:
}
}
-
function toolbar(el) {
+
 
-
                el = typeof el == 'string' ? document.getElementById(el) : el;
+
-
                var elTop = el.offsetTop;
+
-
                var sTop = 0;
+
-
                window.onscroll = function () {
+
-
                    sTop = document.body.scrollTop || document.documentElement.scrollTop;
+
-
                    if (sTop > elTop-10) {
+
-
                        el.style.top = "10px";
+
-
                        el.style.position = "fixed"
+
-
                    } else {
+
-
                        el.style.top = elTop + 'px';
+
-
                        el.style.position = "absolute"
+
-
                    }
+
-
                }
+
-
            }
+
$(document).ready(function(){
$(document).ready(function(){
  $(function(){ $("ul.nav1").hide(); $(".nav1").hover(function(){ $(this).find("ul").stop(true,true); $(this).find("ul").slideDown(); },function(){ $(this).find("ul").stop(true,true); $(this).find("ul").slideUp(); }); })
  $(function(){ $("ul.nav1").hide(); $(".nav1").hover(function(){ $(this).find("ul").stop(true,true); $(this).find("ul").slideDown(); },function(){ $(this).find("ul").stop(true,true); $(this).find("ul").slideUp(); }); })
   });
   });

Revision as of 12:05, 16 August 2014

function displaySubMenu(div) { var subMenu = div.getElementsByTagName("ul")[0]; subMenu.style.display = "block"; } function hideSubMenu(div) { var subMenu = div.getElementsByTagName("ul")[0]; subMenu.style.display = "none"; } function sideMenu(x){ var arr=document.getElementsByName("rnav"); var y=x-1; for(var i=0;i<6;i++){

 if(i==y){
 arr[i].style.display = "block"; 

}

 else{
 arr[i].style.display = "none"; 

} } }


$(document).ready(function(){

$(function(){	$("ul.nav1").hide();		$(".nav1").hover(function(){		$(this).find("ul").stop(true,true);		$(this).find("ul").slideDown();	},function(){		$(this).find("ul").stop(true,true);		$(this).find("ul").slideUp();	});	})
 });