Created
September 5, 2014 11:00
-
-
Save vangog/910796b0da62208cd60b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Change menu background | |
*/ | |
if ( !$.browser.msie || !$.browser.mozilla ) { | |
html2canvas(document.body, { | |
onrendered: function(canvas) { | |
var str = canvas.toDataURL(); | |
$('body').append('<div id="blur_menu_bg"></div>'); | |
$('#blur_menu_bg').css('background-image', 'url(' + str + ')'); | |
$('.bg').blurjs({ | |
source: '#blur_menu_bg', | |
// draggable: true, | |
radius: 15, | |
overlay: 'rgba(222,222,222,0.7)' | |
}); | |
$(window).scroll(function() { | |
//console.log($('.menu').offset().top); | |
var ofs = $('.bg').offset().top - 30; | |
//console.log(ofs); | |
$('.bg').css('background-position', '0px -' + $('.bg').offset().top + 'px'); | |
}); | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment