Evening,
I have one (maybe simple question), which I can't figure out how to do on my own. I'm using Laravel Framework version 4.
How can I check if a user is logged in within javascript? I want the menu bar to fadeout when a user scrolls 100px down, but if the user is logged in then I want it to fadeout when the user scrolls 150px down..
This is how the javascript looks like by now:
(function ($) {
$(document).ready(function(){
$(window).scroll(function() {
var yPos = ( $(window).scrollTop() );
if(yPos > 100) { // show sticky menu after screen has scrolled down 200px from the top
$("#fixed_header").fadeIn(100);
$("#fixed_header_konto").fadeIn(100);
$("#header").fadeOut(100);
$("#header_konto").fadeOut(100);
} else {
$("#fixed_header").fadeOut(100);
$("#fixed_header_konto").fadeOut(100);
$("#header").fadeIn(100);
$("#header_konto").fadeIn(100);
}
});
});
}(jQuery));