tags:

views:

98

answers:

2

i like the jquery.toggle(switch) function as i can do the following in one line;

$('.mytable').toggle(checkboxes[0].checked);

However i cant seem to integrate effects into this call (sliding / fading etc).

Can anyone offer suggestions?

+1  A: 

If you use the following, you can handle evry toggle event yourself. For help with jQuery I suggest http://www.visualjquery.com

$("li").toggle(
  function () {
    $(this).css("list-style-type", "disc")
           .css("color", "blue");
  },
  function () {
    $(this).css({"list-style-type":"", "color":""});
  }
);
MaikL80
A: 

The slideToggle() method offers a simple sliding animation as a transition. Or, you can use the toggle() method and pass in x amount of functions as parameters. The function you pass in can contain the custom animation you desire. The parameters you pass in happen in the order they are passed (resetting to the first one after the last has executed).

qwertypants