Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set -moz-transition property from within JavaScript?

Tags:

javascript

css

I want to implement

-moz-transition: text-shadow 0.25s ease-in-out,font-size 0.25s ease-in-out;

property through JavaScript. What is the syntax for that?

like image 696
Zain Avatar asked Dec 04 '22 22:12

Zain


2 Answers

In raw JavaScript it's:

document.getElementById("yourElem").style.MozTransition = "text-shadow 0.25s ease-in-out,font-size 0.25s ease-in-out";

Note: A preceding hyphen causes an uppercase letter in JavaScript: -moz => Moz

like image 138
Floern Avatar answered Feb 16 '23 00:02

Floern


Use element.style.MozTransition = "text-shadow 0.25s ease-in-out,font-size 0.25s ease-in-out". An example: http://jsfiddle.net/m9Hpc/3/

like image 38
bfontaine Avatar answered Feb 15 '23 22:02

bfontaine