Reputation: 21523
I have a timer. I want one but could use to Start/Pause/Resume. Here is the code
Is it something like
toggleButton.click(function(){
if (){
Clock.start();
self.click(function(){
Clock.pause();
});
} else if (){
Clock.pause();
self.click(function(){
Clock.resume();
})
} else{
Clock.resume();
self.click(function(){
Clock.pause();
})
}
});
It seems working, but I get error in Firebug:
TypeError: self.click is not a function
self.click(function(){
Upvotes: 0
Views: 95
Reputation: 57105
replace self
with $(this)
Read this keyword
Upvotes: 3