crazyghandi crazyghandi - 1 year ago 124
CSS Question

js/css add multiple backgrounds

i have seen several usages of the .css() function or simply setting in js

what i want is to stack multiple backgrounds, ie add another background over the 1st one.

i tried"white url('') no-repeat 30px 6px;");

but the add function is not recognized : TypeError: is not a function

i guess i could set the css after onload with "background1", then reset it as "background1, background2" and back to "background1" when i need to but i would prefer an add() / remove() approach

Answer Source

why not create a few classes :

.bg-1{bg-img ...1}
.bg-2{bg-img ...2}

and use




etc... with a js function with the wanted delay

Warning :

Jquery functions apply to jquery objects, for you :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download