I have a website menu that functions similar to this example: https://jsfiddle.net/sinky/XYGRW/ (found here on stackoverflow)
My query is that the designer would like the logo in the navigation bar (home button) to be replaced with a smaller icon. Not just resizing, but actually changing the image. Can I utilize the scroll event I am already using for other addClass commands to change the img src?
$(window).scroll(function () {
if ($(document).scrollTop() == 0) {
$('#header').removeClass('tiny');
$('#menu-spacing').addClass('nav-margin-top');
} else {
$('#header').addClass('tiny');
$('#menu-spacing').removeClass('nav-margin-top')
}
});
HTML
<div id="header" class="header fixed">
<div class="contain-to-grid">
<nav class="row top-bar">
<ul class="title-area">
<li><img src="img/resolute_logo.png" width="195" height="103" alt=""/> </li>
<li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>
</ul>
<div id="menu-spacing" class="hide-for-medium-down nav-margin-top">