Difference between revisions of "MediaWiki: Common.js"

From Knowledge Federation
Jump to: navigation, search
Line 7: Line 7:
 
   var scroll = $(window).scrollTop();
 
   var scroll = $(window).scrollTop();
 
  if (scroll > 50) {
 
  if (scroll > 50) {
    $("#mw-head").css("padding-top" , "50px");
+
    $("#mw-head").css("padding-top" , "-50px");
 
  }
 
  }
  
 
  else{
 
  else{
  $("#mw-head").css("padding-top" , "100px"); 
+
  $("#mw-head").css("padding-top" , "-100px"); 
 
  }
 
  }
 
   })
 
   })

Revision as of 17:21, 27 November 2018

/* Any JavaScript here will be loaded for all users on every page load. */



$(document).ready(function(){
  $(window).scroll(function(){
  	var scroll = $(window).scrollTop();
	  if (scroll > 50) {
	    $("#mw-head").css("padding-top" , "-50px");
	  }

	  else{
		  $("#mw-head").css("padding-top" , "-100px");  	
	  }
  })
})




/*javascript:alert("hello world");

$(function(){
    $('#mw-head').data('size','big');
});

$(window).scroll(function(){
    if($(document).scrollTop() > 0)
    {
        if($('#mw-head').data('size') == 'big')
        {
            $('#mw-head').data('size','small');
            $('#mw-head').stop().animate({
                height:'65'
            },600);
        }
    }
    else
    {
        if($('#mw-head').data('size') == 'small')
        {
            $('#mw-head').data('size','big');
            $('#mw-head').stop().animate({
                height:'100px'
            },600);
        }  
    }
});*/