Simple img hover change not working. What am I missing?
Frustrated and exhausted. I've created a menu with the following code, but I'm getting this error ("
invalid assignment left-hand side"). Please help.
- <a class="nav-image" href="/menu-link'">
- <img class="image-menu-rollover" src="/image.png">
- <span class="nav-txt">menu-title</span>
- </a>
- jQuery.preloadImages = function() { for(var i = 0; i<arguments.length; i++) { jQuery("<img>").attr("src", arguments[i]); }}
- $.preloadImages('.$images.');
- $(function() { $("a.nav-image").hover(
- function() { $(this).find("img").attr("src") = $(this).find("img").attr("src").replace("_normal","_hover"); },
- function() { $(this).find("img").attr("src") = $(this).find("img").attr("src").replace("_hover","_normal"); }
- );})
What am I missing? Thank you for your time.