Template:Team:Braunschweig/JS template

From 2014.igem.org

var top_menu_height = 0; jQuery(function($) { $(window).load( function() { $('.external-link').unbind('click'); });

       $(document).ready( function() {
           // load google map
       var script = document.createElement('script');
       script.type = 'text/javascript';
       script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' +
           'callback=initialize';
       document.body.appendChild(script);
       top_menu_height = $('.templatemo-top-menu').height();
       // scroll spy to auto active the nav item
       $('body').scrollspy({ target: '#templatemo-nav-bar', offset: top_menu_height + 10 });

$('.external-link').unbind('click');

       // scroll to top
       $('#btn-back-to-top').click(function(e){
           e.preventDefault();
           scrollTo('#templatemo-top');
       });
       // to stick navbar on top
       $('.templatemo-top-menu ').stickUp();
       // gallery category
       $('.templatemo-gallery-category a').click(function(e){
           e.preventDefault(); 
           $(this).parent().children('a').removeClass('active');
           $(this).addClass('active');
           var linkClass = $(this).attr('href');
           $('.gallery').each(function(){
               if($(this).is(":visible") == true){
                  $(this).hide();
               };
           });
           $(linkClass).fadeIn();  
       });
       //gallery light box setup
       $('a.colorbox').colorbox({
                                   rel: function(){
                                       return $(this).data('group');
                                   }
       });
   });

});


function initialize() {

   var mapOptions = {
     zoom: 12,
     center: new google.maps.LatLng(16.8451789,96.1439764)
   };
   var map = new google.maps.Map(document.getElementById('map-canvas'),  mapOptions);

}