Velocity.js // Opacity problems
-
21-12-2019 - |
Question
Having some velocity.js problems with opacity
for example, in the css file :
#background{ opacity: .5 }
and the coffee script part :
$("#backgound").velocity(
opacity: 0
, 350)
velocity won't be of any effect. Same goes with background color : if for example #background{ background-color: rgba(255, 255, 255, 0.5) }
, changing the background color through velocity won't be of any effects neither
Any feedback appreciated on this one!
Solution
Check this [ EXAMPLE ]
I did what you want with both opacity
and backgroundColor
.
Velocity not supporting rgba()
yet, but you can use backgroundColor
with HEX
unit and change its transparency by backgroundColorAlpha
.
Good Luck
OTHER TIPS
You're forgetting to use brackets -->
$("#backgound").velocity({ opacity: 0 }, 350)
try this : braket forgetting!!
$div.velocity({
properties: { opacity: 1 },
options: { duration: 500 }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow