Fading out text at bottom of a section with transparent div, but height stays under section after overlaying div

Answer for 2020: This effect can now be achieved with true alpha transparency, without the need to cover the bottom with an additional <div>. Simply use the CSS mask-image property with a linear gradient that fades from black to transparent. The browser should take care of the rest for you. Demo: .container { -webkit-mask-image: linear-gradient(to … Read more

Cross-Fade between images with CSS in loop

I have taken your fiddle as a base, and made it work without script. updated demo I needed to set an id to the HTML .fadein img { position:absolute; top:0; -webkit-animation-name: fade; -webkit-animation-iteration-count: infinite; -webkit-animation-duration: 6s; animation-name: fade; animation-iteration-count: infinite; animation-duration: 6s; } @-webkit-keyframes fade { 0% {opacity: 0;} 20% {opacity: 1;} 33% {opacity: 1;} … Read more

CSS fade left to right

Yes, you can do it with CSS3 animations (check browser support here). Here’s a simple demo for text-fading. HTML: .text { position:relative; line-height:2em; overflow:hidden; } .fadingEffect { position:absolute; top:0; bottom:0; right:0; width:100%; background:white; -moz-animation: showHide 5s ease-in alternate infinite; /* Firefox */ -webkit-animation: showHide 5s ease-in alternate infinite; /* Safari and Chrome */ -ms-animation: showHide … Read more

Pure JavaScript fade in function

Based on this site EDIT-1 Added the functionality so that user can specify the animation duration(@Marzian comment) You can try this: function fadeIn(el, time) { el.style.opacity = 0; var last = +new Date(); var tick = function() { el.style.opacity = +el.style.opacity + (new Date() – last) / time; last = +new Date(); if (+el.style.opacity < … Read more

CSS3 Fade Effect

You can’t transition between two background images, as there’s no way for the browser to know what you want to interpolate. As you’ve discovered, you can transition the background position. If you want the image to fade in on mouse over, I think the best way to do it with CSS transitions is to put … Read more

How to fade changing background image

This is probably what you wanted: $(‘#elem’).fadeTo(‘slow’, 0.3, function() { $(this).css(‘background-image’, ‘url(‘ + $img + ‘)’); }).fadeTo(‘slow’, 1); With a 1 second delay: $(‘#elem’).fadeTo(‘slow’, 0.3, function() { $(this).css(‘background-image’, ‘url(‘ + $img + ‘)’); }).delay(1000).fadeTo(‘slow’, 1);