Ok, this is a performance question I guess.
I have a slider with two navigation links (next and previous) and when the slider gets to the end of the row I am currently unbinding the next button, then binding again when it goes in the other direction. I am performing the same operation for the next button, but reversed.
the code for the next button would look something like this
if (at end of slider) {
nextBtn.unbind("click")
} else if (not already bound) {
nextBtn.bind("click",clickHandler)
}
So... Is it better do it this way or to have a conditional in the click handler to check for $.data(nextBtn,"state","on")
or $.data(nextBtn,"state","off")