I am trying to find a function that can fade an element from a specified transparency to a specified transparency. For example from 0 to .7 but everything I can find just fades either from 0 to 1 or 1 to 0. I can't find anything that lets you specify from what to what. My attempts of reverse engineering the functions I have found have also failed as every example I have found has been pretty cryptic.
Also I want to do this WITHOUT any frameworks.
Thanks!!
All the frameworks' effect libraries like JQuery or Prototype allow fading from and to arbitrary values.
to:
argumentEdit: Sorry, I overread that you don't want to use any frameworks. But they should at least give you an idea how to do it. Also, it should be easy to tweak any fading function to go from x to y instead of 0 to 1 - You'd just need to adjust the target values of 0 or 1 to something in between.
There is no particular trick to it, you just set the opacity style to something other than 0 or 1 repeatedly in a timeout/interval.
Here's a stripped down fade function you can use as a starting point.
Use code from this example: