• 0

jQuery Fadind Effects


Question

Hi Im having some trouble with this. Im trying to create a fading rollover effect with the help of jQuery

This is the code I have :

<script type="text/javascript">

$(document).ready(function() {

$('.fade').dwFadingLinks({

color: '#515151',

duration: 700

});

});

</script>

and...

jQuery.fn.dwFadingLinks = function(settings) {

settings = jQuery.extend({

}, settings);

return this.each(function() {

var original = $(this).css('color');

$(this).mouseover(function() { $(this).animate({ color: settings.color },settings.duration); });

$(this).mouseout(function() { $(this).animate({ color: original },settings.duration); });

});

};

Right now it changes the font colour as it should, I want to change it so that it changes the background colour as well as the font colour, I cannot get it to work. Any ideas?

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.