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
Post a Comment