Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

give duration to addClass/removeClass

give duration to addClass/removeClass


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
    transition: opacity 1.0s linear;
    -webkit-transition: opacity 1s linear;
.clear {
    opacity: 0;

and the script is

 $('#myVid').bind("ended", function(){  

 $('#myVid').bind("loadstart", function(){          

 $('#myVid').bind("playing", function(){  

can I get some help please?

Problem courtesy of: Nata2ha Mayan2


** EDIT:

try something like: setTimeout("$('#MyT').removeClass('clear')", 500);

. . . . . . . . . . . . . . . . . .

The jQuery's Delay function might help with this.

More details here:

Solution courtesy of: signal2013


View additional discussion.

This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

give duration to addClass/removeClass


Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription