I don’t know why this code is not working:
$(window).scroll(function () {
var $scrtop = $(window).scrollTop(),
$topnavbar = $(".topbar,.navbar-fixed-top");
$topnavbar.mouseenter(function(){
$topnavbar.stop(true,true).fadeTo(4000,1);
}).mouseleave(function(){
$topnavbar.stop(true,true).fadeTo(4000,.5);
})
if( $scrtop > 100 )
{
$topnavbar.stop(true,true).fadeTo(4000,.5);
} else {
$topnavbar.stop(true,true).fadeTo(4000,1);
}
});//scroll
It just goes direct to the final opacity without the stages of the fadeTo().
Here it is in jsfiddle: http://jsfiddle.net/pPr9S/
UPDATED THE CODE
you are to remove second true from stop, because it actually finishes the next animation on the queue;