js comment savoir si l'élément touche la bordure
$(function(){
var $window = $(window),
$header = $('.header'),
$this = $(this); // <-----here you can cache your selectors
$window.on('scroll', function(){
if($this.scrollTop() > 0){
$header.addClass('shadow');
}else{
$header.removeClass('shadow');
}
}).scroll();
});
DevLorenzo