How to change opacity with jQuery fadeTo

I already showed you How to change opacity with jQuery.

In my previous post I used the attribute opacity.

Today we will do the same with the jQuery function fadeTo.

$(document).ready(function(){ $("img").hover(function(){ $(this).fadeTo("slow", 1.0); },function(){ $(this).fadeTo("slow", 0.6); }); });
Code language: JavaScript (javascript)

About Ricard Torres

Senior Front-end Software Engineer at Netcentric, from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> if you need to.

*
*