started responsive dev for mobile
This commit is contained in:
@@ -35,15 +35,20 @@
|
||||
header_height = $header.height(),
|
||||
$slogan = $('#header h2'),
|
||||
fontsize = parseInt($slogan.css('font-size')), tmpfs,
|
||||
scrolltop;
|
||||
scrolltop, limit = 300;
|
||||
|
||||
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;
|
||||
scrolltop = limit - $(this).scrollTop() * .5;
|
||||
scrolltop = Math.max(limit*0.35,scrolltop);
|
||||
// console.log('scrolltop', scrolltop);
|
||||
alpha = scrolltop/limit;
|
||||
console.log('scrolltop '+scrolltop+' | allpha '+alpha);
|
||||
|
||||
$header.height(header_height*alpha);
|
||||
|
||||
tmpfs = fontsize*alpha;
|
||||
$slogan.css('font-size', tmpfs+"px");
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user