May
JavaScript Color Fading Script
Posted by Michael in Design, JavaScriptThis lightweight JavaScript allows for easy color transitions. Add fading effects to tables, divs and more. You can target an elements background, border or text color.
Below is the command to call the function…
colorFade('divid','background','ece7b4','f9bcbc',25,30)
The first parameter is the id of the element you are targeting. The second is the property to fade which can be the background, border or text. The third is the hex value of the starting color. The third is the hex value to fade to. The fourth and fifth are both optional. The first is the the number of times to divide the color difference and the last is the transition speed.
This script has been tested working in IE6/IE7, Firefox, Opera and Safari. Please report all bugs to michael@leigeber.com.
Click here to download the script.
Update 5/5/2008 - I have tweaked a few things and integrated some performance improvements based on Nate’s suggestions.
[...] Si queréis añadir un toque extra de estilo a vuestros sitios y mostrar una transición de color cuando el usuario pinche o pase sobre algún elemento de la página ahora podréis fácilmente con este script: Javascript color fading script [...]
Webmaster Libre | Transiciones de color con Javascript on 03 May 2008 at 5:23 am