I am trying to create the following effect: when I hover on my link, this link changes color, this part works, but the problem with my code is that I can not see my text when I am. I know that I can solve this problem by adding images to my span and anchor tag, and I also know that there is a plugin that animates color, but IF POSSIBLE I would like to enable this WITHOUT background images and plugins. Is it possible?
I created this FIDDLE so you can see my problem.
My code is:
$(document).ready(function () { $('.link').hover(function () { var heightCheck = $(this).outerHeight(); //alert(heightCheck); $(this).stop().animate({ opacity: 0 }, 1000); $('.yellow').height(heightCheck); $('.yellow').css({ 'margin-top': -heightCheck }); }, function (heightCheck) { $(this).stop().animate({ opacity: 1 }, 1000, function () { $('.yellow').css({ 'margin-top': +heightCheck }); }); }); });
source share