I'm trying to get my navbar to change when I scroll down. So far, I have the following HTML code:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/portfolio/logopequeno.png" style="display:inline" class="img-responsive">
<a class="navbar-brand" style="display:inline" href="#page-top"> TEXTO EXEMPLO</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="hidden">
<a href="#page-top"></a>
</li>
<li class="page-scroll">
<a href="#portfolio">COMO FUNCIONA</a>
</li>
<li class="page-scroll">
<a href="#about">ASSISTA</a>
</li>
<li class="page-scroll">
<a href="#contact">APOIE</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
And javascript:
$(function() {
$('body').on('click', '.page-scroll a', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
When I scroll down, the navbar and text "TEXT EXAMPLE" are smaller, but the image is not changed.
What you would like to do is scroll down, add text and only the image, but smaller (50% of the original)
Is it possible?