I have a div which contains elements. When I click on one element an action will occur. During the action time I want to make my div colors change to black & white and after the action it will reset the color.
So I create a simple css3 class :
gray {
background-color:red;
-moz-filter: grayscale(100%);
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
And in my script I have two functions :
function enableWaitState( ) {
$($("#chart")).addClass( "gray");
}
function disableWaitState( ) {
$($("#chart")).removeClass( "gray");
}
in my javascript code I write the method which is called when clicking on a button:
function back() {
enableWaitState( );
// here doing some javascript code
disableWaitState( );
}
}
Unfortunately it doesn't work. But If I make an ajax call between enableWaitState() and disableWaitState(), it works!
Any ideas?
<>button), linking required external resources and making sure you problem can be experienced.