Team:SDU-Denmark/core/scripts

From 2013.igem.org

(Difference between revisions)
Line 41: Line 41:
{
{
   var pathname = window.location.pathname;
   var pathname = window.location.pathname;
-
   console.log(pathname);
+
   if (pathname.toLowerCase().indexOf('test') < 0) {
-
console.log(pathname.toLowerCase().indexOf('test'));
+
    $('.testing').hide();
-
      if (pathname.toLowerCase().indexOf('test') < 0) {
+
  }
-
          $('.testing').hide();
+
-
      }
+
}
}
$(document).ready(function () {
$(document).ready(function () {

Revision as of 10:24, 11 August 2013

function handleStickyTopBar() {

   var viewportHeight = $(window).height();
   var totalPageHeight = $(document).height();
   if (totalPageHeight > viewportHeight) {
       $(".MainLayout").css("margin-bottom", "100px");
   }
   else {
       $(".MainLayout").css("margin-bottom", "0");
   }
   var window_top = $(window).scrollTop();
   var div_top = $('#sticky-anchor').offset().top;
   if (window_top > div_top) {
       $('.top').addClass('stick');
       $(".topMargin").css("margin-top", "113px");
   } else {
       $('.top').removeClass('stick');
       $(".topMargin").css("margin-top", "25px");
   }

} function enableMenuDropdown() {

   $('#btnMenu, .menuPopup, #btnMenu2').hover(
       function () {
           $('.menuPopup').show();
       },
       function () {
           $('.menuPopup').hide();
       }
   );

} function styleIGEMTopMenu() {

   $('.left-menu').children().first().children().last().css('color', );
   $('.left-menu').children().first().children().last().css('font-size', '10px');
   $('#menubar').bind("mouseover", function () {
       $(this).css("background", "transparent");
       $('#menubar').css("background", "transparent");
   });

}

function hideTestElementsOnLiveSite() {

 var pathname = window.location.pathname;
 if (pathname.toLowerCase().indexOf('test') < 0) {
    $('.testing').hide();
 }

} $(document).ready(function () {

   styleIGEMTopMenu();
   $(window).scroll(handleStickyTopBar);
   enableMenuDropdown();
   hideTestElementsOnLiveSite();

});