jquery image swap works in one html file but not another
- by Jon
I have two header templates for my site. One for the blog section and one for everything else. The below code swaps an image in my nav menu, on hover. It works for one template but not the other. The html code is pretty much identical in both header templates.
Please help me!!
$(document).ready(function(){
$('.nav-home, .nav-port, .nav-exp, .nav-cont, .nav-blog').hover(function(){
$(this).attr('src','/images/' + $(this).attr('class') + '-hover.gif');
}, function(){
$(this).attr('src','/images/' + $(this).attr('class') + '.gif');
});
});