started fixed header, fixed anchor links with fixed header
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
|
||||
(function($){Drupal.behaviors.init_theme=function(context){$('#messages-and-help > div.messages:not(.processed)').addClass('processed').each(function(){if($('a',this).size()||$(this).is('.error')||$(this).is('.warning')||$(this).text().length>100){$(this).prepend("<span class='close'>X</span>");$('span.close',this).click(function(){$(this).parent().slideUp('fast');});}
|
||||
else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};})(jQuery);
|
||||
else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};function init(){console.log('Clameurs Theme');initHeaderAnime();};function initHeaderAnime(){var $header=$('#header a'),header_height=$header.height(),$slogan=$('#header h2'),fontsize=parseInt($slogan.css('font-size')),tmpfs,scrolltop;console.log('font-size',fontsize);$(window).on('scroll',function(event){scrolltop=$(this).scrollTop()*.5;console.log('scrolltop',scrolltop);$header.height(header_height-scrolltop>90?header_height-scrolltop:90);tmpfs=(300-(scrolltop<100?scrolltop:100))/300*fontsize;$slogan.css('font-size',tmpfs+"px");});};init();})(jQuery);
|
||||
@@ -25,5 +25,29 @@
|
||||
});
|
||||
};
|
||||
|
||||
function init(){
|
||||
console.log('Clameurs Theme');
|
||||
initHeaderAnime();
|
||||
};
|
||||
|
||||
function initHeaderAnime(){
|
||||
var $header = $('#header a'),
|
||||
header_height = $header.height(),
|
||||
$slogan = $('#header h2'),
|
||||
fontsize = parseInt($slogan.css('font-size')), tmpfs,
|
||||
scrolltop;
|
||||
|
||||
console.log('font-size', fontsize);
|
||||
|
||||
$(window).on('scroll', function(event) {
|
||||
scrolltop = $(this).scrollTop() * .5;
|
||||
console.log('scrolltop', scrolltop);
|
||||
$header.height(header_height-scrolltop > 90 ? header_height-scrolltop : 90);
|
||||
tmpfs = (300 - (scrolltop < 100 ? scrolltop : 100)) / 300 * fontsize;
|
||||
$slogan.css('font-size', tmpfs+"px");
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user