I’m trying to set up a few add/removeClass functions, of the same class, depending on what’s happening. It works, but the problem is one (the function binded to loadstart) needs a duration of a different length than the other two, so putting transition-duration doesn’t work.
I’ve looked around for a way, but they’re not working.
the css is
#MyT{
height:786px;
width:1024px;
position:absolute;
z-index:2;
transition: opacity 1.0s linear;
-webkit-transition: opacity 1s linear;
margin-left:-8px;
margin-top:-16px;
}
.clear {
opacity: 0;
}
and the script is
$('#myVid').bind("ended", function(){
$('#MyT').removeClass('clear');
});
$('#myVid').bind("loadstart", function(){
$('#MyT').removeClass('clear');
});
$('#myVid').bind("playing", function(){
$('#MyT').addClass('clear');
});
can I get some help please?
** EDIT:
try something like:
setTimeout("$('#MyT').removeClass('clear')", 500);. . . . . . . . . . . . . . . . . .
The jQuery’s Delay function might help with this.
More details here: http://api.jquery.com/delay/