Checkbox check should automatically and slowly fadeout to unchecked
-
I have created a elevator functionality [there are 2 floors and corresponding to each one , there is a checkbox. Depending upon which checkbox is checked, the elevator should move to that floor. Only thing which i am not able to implement here is: Make the checkbox check automatically and slowly fadeout to unchecked state when the orange elevator has reached that checkbox. Here is the link to the markup and script: http://jsfiddle.net/hurricaneankit/qR4uJ/
-
I have created a elevator functionality [there are 2 floors and corresponding to each one , there is a checkbox. Depending upon which checkbox is checked, the elevator should move to that floor. Only thing which i am not able to implement here is: Make the checkbox check automatically and slowly fadeout to unchecked state when the orange elevator has reached that checkbox. Here is the link to the markup and script: http://jsfiddle.net/hurricaneankit/qR4uJ/
Hmmm... i would use a loop (for / next) to change the Color from yellow to the background in small steps and the opposite way to fade it in on the other box... Martin
-
I have created a elevator functionality [there are 2 floors and corresponding to each one , there is a checkbox. Depending upon which checkbox is checked, the elevator should move to that floor. Only thing which i am not able to implement here is: Make the checkbox check automatically and slowly fadeout to unchecked state when the orange elevator has reached that checkbox. Here is the link to the markup and script: http://jsfiddle.net/hurricaneankit/qR4uJ/
For your animate() function, you can pass in a function to execute when the animation is completed. You can't "fade" your checkbox, but you can un-check it.
$(function(){
$(document).ready(function () {
$("#check1").click(function () {
$("#check1").toggleClass('checked');
$("#check2").removeClass('checked');
$("#groundDiv").animate({
"top": "0px"
}, 1000, function () {
//put code here to un-check the box
});
});
});