How to replace “home” button with another text when I hover by mouse on it instead of it repeating itself?
<ul class="topnav">
<li><a href="#">Home</a></li>
</ul>
jQuery(function($) {
$('.topnav li').find('a[href]').parent().each(function(span, li){
li = $(li); span = $('<span>' + li.find('a').html() + '<\/span>');
li.hover(function(){
span.stop().animate({marginTop: '-60'}, 250);
}, function(){
span.stop().animate({marginTop: '0'}, 250);
}).prepend(span);
});
});
Here is the example: http://jsfiddle.net/fxdigi/3YNHp/1/
Check my variant http://jsfiddle.net/3YNHp/5/
It uses markup:
And changed javascript: