I’m using jquery toggle() to change some css like this and it works great…
$("#button").toggle(
function(){
$("#playlist").css("bottom","0");
},
function(){
$("#playlist").css("bottom","-200px");
}
);
I want to trigger this same thing when the letter m is pressed, so i added it to a case (it is set up where i can make a case for the key pressed):
....
case 77: // M
What object to I bind to the toggle function?
What Object do I use there to do the same function as above?
Thank you everyone for your really helpful answers!
To invoke an event handler manually, first you must define your functions as named functions instead of anonymous functions:
Next, you can then invoke the handlers manually and use a boolean as a switch: