help with toggle animation

help with toggle animation

I am having trouble giving my toggle function an animation, I just want it animate when it opens/close
  1. $(document).ready(function() {
  2. var adjustheight = 80;
  3. $(".view-gallery-trigger").toggle(function() {
  4. $('#view-gallery').css('height', 'auto').css('overflow', 'visible');
  5. $(this).addClass('opened');
  6. $(this).removeClass('closed');
  7. }, function() {
  8. $('#view-gallery').css('height', adjustheight).css('overflow', 'hidden');
  9. $(this).addClass('closed');
  10. $(this).removeClass('opened');
  11. });
  12. });

but when i have it read "toggle("slow",function()" the script doesn't work