hello i'm trying to make a div have a background image but only for a specific time: pseudo code: div has background image, after 1 sec passed div has background none, anyway doing this in jquery? regards
+3
A:
You can try delay in jQuery 1.4+
$('#someDivID').delay(1000).css('background', 'none');
Otherwise you can use setTimeout:
setTimeout(function() { $('#someDivID').css('background', 'none'); }, 1000);
Jacob Relkin
2010-07-01 22:51:22
sorry , the numbers of milli or sec is whatever.(my bad for the syntax)
tada
2010-07-01 23:17:14
@tada it's in miliseconds. A good way of finding that out is just googling *setTimeout javascript* and looking at what comes up.
Pim Jager
2010-07-01 23:51:12
A:
$("div.removebg")
.delay(1000000) // miliseconds
.animate{
background: 'none'
},
100);
Marko
2010-07-01 22:53:32