Is it possible to add a javascript variable into a JQuery .css()? -


i have javascript function loop in it

function blackout() { 'use strict'; (i = 100; > 0; = - 1) {     $("body").css();     } } 

i want add css code using jquery function .css()

-webkit-filter: brightness(i); filter: brightness(i); 

such screen blackout.

what write inside .css() allow me have variable 'i' inside well?

this should make trick:

function blackout() { 'use strict'; $body = $("body"); (i = 100; > 0; = - 1) {     $body.css('-webkit-filter', 'brightness('+ +')');     $body.css('filter', 'brightness('+ +')');     } } 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -