Team:BIT-China/js/index.js

From 2013.igem.org

(Difference between revisions)
Line 1: Line 1:
(function(){var $w=$(window);$w.scroll(function(){$('.header-icon div, .wrap > h1, .wrap > h2, #googlemap').each(function(index){var section_top=$(this).offset().top;if($w.scrollTop()>=section_top-400&&$(this).hasClass('invisible')){$(this).removeClass('invisible');if($(this).is('.header-icon div')){var self=this;setTimeout(function(){$(self).parent().removeClass('invisible');},1000);$(this).animate({height:128,marginLeft:0,marginTop:0,opacity:1,width:128},{duration:1000,queue:false});}else{$(this).animate({marginLeft:0,opacity:1},{duration:500});}}else if($w.scrollTop()<section_top-400&&!$(this).hasClass('invisible')){$(this).addClass('invisible');if($(this).is('.header-icon div')){$(this).parent().addClass('invisible');$(this).animate({height:0,marginLeft:64,marginTop:64,opacity:0,width:0},{duration:500,queue:false});}else{$(this).animate({marginLeft:(index%2?-284:284),opacity:0},{duration:500,queue:false});}}});$('#sitemap section, .sun').each(function(index){var section_top_start=$(this).offset().top-300;var section_top_end=$(this).offset().top-400;var element=$(this);var animation;if($(this).is('.sun'))animation='sunentrance';else
(function(){var $w=$(window);$w.scroll(function(){$('.header-icon div, .wrap > h1, .wrap > h2, #googlemap').each(function(index){var section_top=$(this).offset().top;if($w.scrollTop()>=section_top-400&&$(this).hasClass('invisible')){$(this).removeClass('invisible');if($(this).is('.header-icon div')){var self=this;setTimeout(function(){$(self).parent().removeClass('invisible');},1000);$(this).animate({height:128,marginLeft:0,marginTop:0,opacity:1,width:128},{duration:1000,queue:false});}else{$(this).animate({marginLeft:0,opacity:1},{duration:500});}}else if($w.scrollTop()<section_top-400&&!$(this).hasClass('invisible')){$(this).addClass('invisible');if($(this).is('.header-icon div')){$(this).parent().addClass('invisible');$(this).animate({height:0,marginLeft:64,marginTop:64,opacity:0,width:0},{duration:500,queue:false});}else{$(this).animate({marginLeft:(index%2?-284:284),opacity:0},{duration:500,queue:false});}}});$('#sitemap section, .sun').each(function(index){var section_top_start=$(this).offset().top-300;var section_top_end=$(this).offset().top-400;var element=$(this);var animation;if($(this).is('.sun'))animation='sunentrance';else
-
animation='bounce';if($w.scrollTop()>=section_top_start&&!element.hasClass(animation)){element.css({opacity:1,zIndex:3}).addClass(animation);}else if($w.scrollTop()<section_top_end&&element.hasClass(animation)){element.removeClass(animation).animate({opacity:0},{duration:100,queue:false,complete:function(){$(this).css('zIndex',-1);}});}});});$(document).ready(function(){$("#idea").hover(function(){$("#idea").css("background-color","rgba(58, 153, 211, 0.85)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(58, 153, 211, 0.85)");$("#cover").css("background-color","rgb(58, 153, 211)");$("#display-img-idea").css("display","block");$("#display-img-idea").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#advantage").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(118, 181, 71, 0.85098)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(118, 181, 71, 0.85098)");$("#cover").css("background-color","rgb(118, 181, 71)");$("#display-img-advantage").css("display","block");$("#display-img-advantage").css("visibility","visible");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#description").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(234, 58, 58, 0.85098)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(234, 58, 58, 0.85)");$("#cover").css("background-color","rgb(234, 58, 58)");$("#display-img-description").css("display","block");$("#display-img-description").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#charactors").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(133, 133, 197, 0.85098)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(133, 133, 197, 0.85098)");$("#cover").css("background-color","rgb(133, 133, 197)");$("#display-img-charactors").css("display","block");$("#display-img-charactors").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#extend").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(255, 165, 0, 0.85098)");$("#laptop-screen").css("background","rgba(255, 165, 0, 0.85098)");$("#cover").css("background-color","rgb(255, 165, 0)");$("#display-img-extend").css("display","block");$("#display-img-extend").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");},function(){});$("#teamphoto").hover(function(){document.getElementById("teamphoto").style.width="721px";document.getElementById("teamphoto").style.marginTop="-390px";},function(){document.getElementById("teamphoto").style.width="250px";document.getElementById("teamphoto").style.marginTop="-90px";});})})();function scrollToElement(id,speed,num){$('html,body').animate({scrollTop:$("#"+id).offset().top+num},speed,function(){});}function flipdown(){var $w=$(window);var sitemap=$("#sitemap").offset().top-110;var story=$('#story').offset().top-110;var about=$('#about').offset().top-110;var contact=$('#contact').offset().top-110;if($w.scrollTop()<sitemap){scrollToElement('sitemap','slow',425);return;}if($w.scrollTop()<story){scrollToElement('story','slow',75);return;}if($w.scrollTop()<about){scrollToElement('about','slow',105);return;}if($w.scrollTop()<contact){scrollToElement('contact','slow',0);return;}else{scrollToElement('contact','slow',200);return;}}global_current_elem=0;var interval_variable=setInterval("autoScroll()",8000);function autoScroll(){scrollRight();}function scrollRight(){if(global_current_elem==3){global_current_elem=0;}else{global_current_elem=global_current_elem+1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);if(global_current_elem==0){$('#story1_gem').css('opacity','1');};}function scrollLefty(){if(global_current_elem==0){global_current_elem=3;}else{global_current_elem=global_current_elem-1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);}function set_active_btn(elem){jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+elem+"_btn").addClass("active");}function change(num){$('#myCarousel').carousel(num-1);jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+num+"_btn").addClass("active");}var map;var marker;var n=0;function isInfoBoxOpen(infoBox){var map=infoBox.getMap();return(map===null||typeof map==="undefined");}function initialize(){var myLatlng=new google.maps.LatLng(39.959758,116.31615);var mapOptions={zoom:11,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById('googlemap'),mapOptions);var boxText=document.createElement("div");boxText.innerHTML="<aside class='hatch'>"+"<div class='icon-BIT'><img src='./img/sponsers/BIT.png' width='100'/></div>"+"<dl>"+"<dt>School</dt>"+"<dd>Beijing Institute Of Technology</dd>"+"<dt>Postcode</dt>"+"<dd>100081</dd>"+"<dt>Address</dt>"+"<dd>5 South Zhongguancun Street, Haidian District, Beijing</dd>"+"<dt>Email</dt>"+"<dd>singlewindy@gmail.com</dd>"+"</dl>"+"</aside>";var myOptions={content:boxText,disableAutoPan:false,maxWidth:0,pixelOffset:new google.maps.Size(-140,0),zIndex:null,boxStyle:{},infoBoxClearance:new google.maps.Size(1,1),closeBoxURL:"",isHidden:false,pane:"floatPane",enableEventPropagation:false};var ib=new InfoBox(myOptions);marker=new google.maps.Marker({position:myLatlng,map:map,draggable:true,animation:google.maps.Animation.DROP});ib.open(map,marker);google.maps.event.addListener(marker,'click',toggleBounce);google.maps.event.addListener(marker,'click',function(){if(!isInfoBoxOpen(ib)){ib.close(map,marker);}else{ib.open(map,marker);}n=n+1;});}function toggleBounce(){if(marker.getAnimation()!=null){marker.setAnimation(null);}else{marker.setAnimation(google.maps.Animation.BOUNCE);for(var i=0;i<=1000;i++);marker.setAnimation(null);}}google.maps.event.addDomListener(window,'load',initialize);
+
animation='bounce';if($w.scrollTop()>=section_top_start&&!element.hasClass(animation)){element.css({opacity:1,zIndex:3}).addClass(animation);}else if($w.scrollTop()<section_top_end&&element.hasClass(animation)){element.removeClass(animation).animate({opacity:0},{duration:100,queue:false,complete:function(){$(this).css('zIndex',-1);}});}});});$(document).ready(function(){$("#idea").hover(function(){$("#idea").css("background-color","rgba(58, 153, 211, 0.85)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(58, 153, 211, 0.85)");$("#cover").css("background-color","rgb(58, 153, 211)");$("#display-img-idea").css("display","block");$("#display-img-idea").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#advantage").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(118, 181, 71, 0.85098)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(118, 181, 71, 0.85098)");$("#cover").css("background-color","rgb(118, 181, 71)");$("#display-img-advantage").css("display","block");$("#display-img-advantage").css("visibility","visible");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#description").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(234, 58, 58, 0.85098)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(234, 58, 58, 0.85)");$("#cover").css("background-color","rgb(234, 58, 58)");$("#display-img-description").css("display","block");$("#display-img-description").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#charactors").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(133, 133, 197, 0.85098)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(133, 133, 197, 0.85098)");$("#cover").css("background-color","rgb(133, 133, 197)");$("#display-img-charactors").css("display","block");$("#display-img-charactors").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#extend").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(255, 165, 0, 0.85098)");$("#laptop-screen").css("background","rgba(255, 165, 0, 0.85098)");$("#cover").css("background-color","rgb(255, 165, 0)");$("#display-img-extend").css("display","block");$("#display-img-extend").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");},function(){});$("#teamphoto").hover(function(){document.getElementById("teamphoto").style.width="721px";document.getElementById("teamphoto").style.marginTop="-420px";},function(){document.getElementById("teamphoto").style.width="250px";document.getElementById("teamphoto").style.marginTop="-120px";});})})();function scrollToElement(id,speed,num){$('html,body').animate({scrollTop:$("#"+id).offset().top+num},speed,function(){});}function flipdown(){var $w=$(window);var sitemap=$("#sitemap").offset().top-110;var story=$('#story').offset().top-110;var about=$('#about').offset().top-110;var contact=$('#contact').offset().top-110;if($w.scrollTop()<sitemap){scrollToElement('sitemap','slow',425);return;}if($w.scrollTop()<story){scrollToElement('story','slow',75);return;}if($w.scrollTop()<about){scrollToElement('about','slow',105);return;}if($w.scrollTop()<contact){scrollToElement('contact','slow',0);return;}else{scrollToElement('contact','slow',200);return;}}global_current_elem=0;var interval_variable=setInterval("autoScroll()",8000);function autoScroll(){scrollRight();}function scrollRight(){if(global_current_elem==3){global_current_elem=0;}else{global_current_elem=global_current_elem+1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);if(global_current_elem==0){$('#story1_gem').css('opacity','1');};}function scrollLefty(){if(global_current_elem==0){global_current_elem=3;}else{global_current_elem=global_current_elem-1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);}function set_active_btn(elem){jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+elem+"_btn").addClass("active");}function change(num){$('#myCarousel').carousel(num-1);jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+num+"_btn").addClass("active");}var map;var marker;var n=0;function isInfoBoxOpen(infoBox){var map=infoBox.getMap();return(map===null||typeof map==="undefined");}function initialize(){var myLatlng=new google.maps.LatLng(39.959758,116.31615);var mapOptions={zoom:11,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById('googlemap'),mapOptions);var boxText=document.createElement("div");boxText.innerHTML="<aside class='hatch'>"+"<div class='icon-BIT'><img src='./img/sponsers/BIT.png' width='100'/></div>"+"<dl>"+"<dt>School</dt>"+"<dd>Beijing Institute Of Technology</dd>"+"<dt>Postcode</dt>"+"<dd>100081</dd>"+"<dt>Address</dt>"+"<dd>5 South Zhongguancun Street, Haidian District, Beijing</dd>"+"<dt>Email</dt>"+"<dd>singlewindy@gmail.com</dd>"+"</dl>"+"</aside>";var myOptions={content:boxText,disableAutoPan:false,maxWidth:0,pixelOffset:new google.maps.Size(-140,0),zIndex:null,boxStyle:{},infoBoxClearance:new google.maps.Size(1,1),closeBoxURL:"",isHidden:false,pane:"floatPane",enableEventPropagation:false};var ib=new InfoBox(myOptions);marker=new google.maps.Marker({position:myLatlng,map:map,draggable:true,animation:google.maps.Animation.DROP});ib.open(map,marker);google.maps.event.addListener(marker,'click',toggleBounce);google.maps.event.addListener(marker,'click',function(){if(!isInfoBoxOpen(ib)){ib.close(map,marker);}else{ib.open(map,marker);}n=n+1;});}function toggleBounce(){if(marker.getAnimation()!=null){marker.setAnimation(null);}else{marker.setAnimation(google.maps.Animation.BOUNCE);for(var i=0;i<=1000;i++);marker.setAnimation(null);}}google.maps.event.addDomListener(window,'load',initialize);

Revision as of 16:35, 27 September 2013

(function(){var $w=$(window);$w.scroll(function(){$('.header-icon div, .wrap > h1, .wrap > h2, #googlemap').each(function(index){var section_top=$(this).offset().top;if($w.scrollTop()>=section_top-400&&$(this).hasClass('invisible')){$(this).removeClass('invisible');if($(this).is('.header-icon div')){var self=this;setTimeout(function(){$(self).parent().removeClass('invisible');},1000);$(this).animate({height:128,marginLeft:0,marginTop:0,opacity:1,width:128},{duration:1000,queue:false});}else{$(this).animate({marginLeft:0,opacity:1},{duration:500});}}else if($w.scrollTop()<section_top-400&&!$(this).hasClass('invisible')){$(this).addClass('invisible');if($(this).is('.header-icon div')){$(this).parent().addClass('invisible');$(this).animate({height:0,marginLeft:64,marginTop:64,opacity:0,width:0},{duration:500,queue:false});}else{$(this).animate({marginLeft:(index%2?-284:284),opacity:0},{duration:500,queue:false});}}});$('#sitemap section, .sun').each(function(index){var section_top_start=$(this).offset().top-300;var section_top_end=$(this).offset().top-400;var element=$(this);var animation;if($(this).is('.sun'))animation='sunentrance';else

animation='bounce';if($w.scrollTop()>=section_top_start&&!element.hasClass(animation)){element.css({opacity:1,zIndex:3}).addClass(animation);}else if($w.scrollTop()<section_top_end&&element.hasClass(animation)){element.removeClass(animation).animate({opacity:0},{duration:100,queue:false,complete:function(){$(this).css('zIndex',-1);}});}});});$(document).ready(function(){$("#idea").hover(function(){$("#idea").css("background-color","rgba(58, 153, 211, 0.85)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(58, 153, 211, 0.85)");$("#cover").css("background-color","rgb(58, 153, 211)");$("#display-img-idea").css("display","block");$("#display-img-idea").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#advantage").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(118, 181, 71, 0.85098)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(118, 181, 71, 0.85098)");$("#cover").css("background-color","rgb(118, 181, 71)");$("#display-img-advantage").css("display","block");$("#display-img-advantage").css("visibility","visible");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#description").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(234, 58, 58, 0.85098)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(234, 58, 58, 0.85)");$("#cover").css("background-color","rgb(234, 58, 58)");$("#display-img-description").css("display","block");$("#display-img-description").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#charactors").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(133, 133, 197, 0.85098)");$("#extend").css("background-color","rgba(0, 0, 0, 0)");$("#laptop-screen").css("background","rgba(133, 133, 197, 0.85098)");$("#cover").css("background-color","rgb(133, 133, 197)");$("#display-img-charactors").css("display","block");$("#display-img-charactors").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");$("#display-img-extend").css("display","none");$("#display-img-extend").css("visibility","hidden");},function(){});$("#extend").hover(function(){$("#idea").css("background-color","rgba(0, 0, 0, 0)");$("#advantage").css("background-color","rgba(0, 0, 0, 0)");$("#description").css("background-color","rgba(0, 0, 0, 0)");$("#charactors").css("background-color","rgba(0, 0, 0, 0)");$("#extend").css("background-color","rgba(255, 165, 0, 0.85098)");$("#laptop-screen").css("background","rgba(255, 165, 0, 0.85098)");$("#cover").css("background-color","rgb(255, 165, 0)");$("#display-img-extend").css("display","block");$("#display-img-extend").css("visibility","visible");$("#display-img-advantage").css("display","none");$("#display-img-advantage").css("visibility","hidden");$("#display-img-description").css("display","none");$("#display-img-description").css("visibility","hidden");$("#display-img-charactors").css("display","none");$("#display-img-charactors").css("visibility","hidden");$("#display-img-idea").css("display","none");$("#display-img-idea").css("visibility","hidden");},function(){});$("#teamphoto").hover(function(){document.getElementById("teamphoto").style.width="721px";document.getElementById("teamphoto").style.marginTop="-420px";},function(){document.getElementById("teamphoto").style.width="250px";document.getElementById("teamphoto").style.marginTop="-120px";});})})();function scrollToElement(id,speed,num){$('html,body').animate({scrollTop:$("#"+id).offset().top+num},speed,function(){});}function flipdown(){var $w=$(window);var sitemap=$("#sitemap").offset().top-110;var story=$('#story').offset().top-110;var about=$('#about').offset().top-110;var contact=$('#contact').offset().top-110;if($w.scrollTop()<sitemap){scrollToElement('sitemap','slow',425);return;}if($w.scrollTop()<story){scrollToElement('story','slow',75);return;}if($w.scrollTop()<about){scrollToElement('about','slow',105);return;}if($w.scrollTop()<contact){scrollToElement('contact','slow',0);return;}else{scrollToElement('contact','slow',200);return;}}global_current_elem=0;var interval_variable=setInterval("autoScroll()",8000);function autoScroll(){scrollRight();}function scrollRight(){if(global_current_elem==3){global_current_elem=0;}else{global_current_elem=global_current_elem+1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);if(global_current_elem==0){$('#story1_gem').css('opacity','1');};}function scrollLefty(){if(global_current_elem==0){global_current_elem=3;}else{global_current_elem=global_current_elem-1;}$('#myCarousel').carousel(global_current_elem);set_active_btn(global_current_elem+1);}function set_active_btn(elem){jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+elem+"_btn").addClass("active");}function change(num){$('#myCarousel').carousel(num-1);jQuery("#aktuals1_btn").removeClass("active");jQuery("#aktuals2_btn").removeClass("active");jQuery("#aktuals3_btn").removeClass("active");jQuery("#aktuals4_btn").removeClass("active");jQuery("#aktuals"+num+"_btn").addClass("active");}var map;var marker;var n=0;function isInfoBoxOpen(infoBox){var map=infoBox.getMap();return(map===null||typeof map==="undefined");}function initialize(){var myLatlng=new google.maps.LatLng(39.959758,116.31615);var mapOptions={zoom:11,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById('googlemap'),mapOptions);var boxText=document.createElement("div");boxText.innerHTML="<aside class='hatch'>"+"
<img src='./img/sponsers/BIT.png' width='100'/>
"+"
"+"
School</dt>"+"
Beijing Institute Of Technology</dd>"+"
Postcode</dt>"+"
100081</dd>"+"
Address</dt>"+"
5 South Zhongguancun Street, Haidian District, Beijing</dd>"+"
Email</dt>"+"
singlewindy@gmail.com</dd>"+"
"+"</aside>";var myOptions={content:boxText,disableAutoPan:false,maxWidth:0,pixelOffset:new google.maps.Size(-140,0),zIndex:null,boxStyle:{},infoBoxClearance:new google.maps.Size(1,1),closeBoxURL:"",isHidden:false,pane:"floatPane",enableEventPropagation:false};var ib=new InfoBox(myOptions);marker=new google.maps.Marker({position:myLatlng,map:map,draggable:true,animation:google.maps.Animation.DROP});ib.open(map,marker);google.maps.event.addListener(marker,'click',toggleBounce);google.maps.event.addListener(marker,'click',function(){if(!isInfoBoxOpen(ib)){ib.close(map,marker);}else{ib.open(map,marker);}n=n+1;});}function toggleBounce(){if(marker.getAnimation()!=null){marker.setAnimation(null);}else{marker.setAnimation(google.maps.Animation.BOUNCE);for(var i=0;i<=1000;i++);marker.setAnimation(null);}}google.maps.event.addDomListener(window,'load',initialize);