Hi, all!

Code taken from a recent post:

$("#toggle").click(function(){
                $("#calendar .arc").toggle();
        $("#calendar .arc").Highlight(1000, '#ff9');
...

that made me think: the highlight is useless(?) when the object is
hidden, but of course desired when it is shown. That could be
elegantly solved by adding two optional callbacks to toggle():

$("#toggle").click(function(){
  $("#calendar .arg").toggle(
    function(){$(this).Highlight(1000,'#ff9');}, // called when shown
    function(){...} // called when hidden
  ); // toggle()
...
} // click()

i believe this could be done without harming backwards-compatibility?

Thoughts?

Reply via email to