[removed] Fade element from specidied opacity to specified opacity?

前端 未结 3 704
执笔经年
执笔经年 2020-12-22 11:04

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 fa

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 11:57

    All the frameworks' effect libraries like JQuery or Prototype allow fading from and to arbitrary values.

    • In JQuery: FadeTo
    • In Prototype: Fade with the to: argument

    Edit: 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.

提交回复
热议问题