no-framework

Javascript: Fade element from specidied opacity to specified opacity?

冷暖自知 提交于 2019-11-29 17:54:01
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!! 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

Javascript: Fade element from specidied opacity to specified opacity?

只谈情不闲聊 提交于 2019-11-28 12:30:37
问题 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!! 回答1: There is no particular trick to