The most obvious problem with running the two scripts together is that both apply the class "fixed" to the elements that are pinned in position. To prevent this, you could change the class in one script:
nagging-menu.js changed from 'fixed' to 'fixed-side'
Code Javascript:
$(function(){
var menu = $('#menu'),
pos = menu.offset();
$(window).scroll(function(){
if($(this).scrollTop() > pos.top+menu.height() && menu.hasClass('default')){
menu.fadeOut('fast', function(){
$(this).removeClass('default').addClass('fixed-side').fadeIn('fast');
});
} else if($(this).scrollTop() <= pos.top && menu.hasClass('fixed-side')){
menu.fadeOut('fast', function(){
$(this).removeClass('fixed-side').addClass('default').fadeIn('fast');
});
}
});
});
and the .fixed selector in style.css to .fixed-side
Code CSS:
.fixed-side {
position: fixed;
top: -5px;
left: 0;
width: 100%;
box-shadow: 0 0 40px #222;
-webkit-box-shadow: 0 0 40px #222;
-moz-box-shadow: 0 0 40px #222;
}
Apart from this, it would be necessary to see a working example to take it any further.
Bookmarks