Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

1 of 2

Here is what is going on - in your ternary operation, on the last line, you are trying to call two functions. That is not possible. You need to use an if block. Here is how I rewrote it. I don't know if you are using the doIt variable for any purpose, but you will want to check for undefined:

$('.holder').on('click','a',function(e){ 
 e.preventDefault();
 var $allextended = $(this).closest('.wrapperdoo').find('.extended'),
 $extended = $allextended.eq( $(this).index() ),
 doIt = undefined;
 if ($extended.is(":visible")) {
 doIt = $extended.slideUp(); 
 } else {
 $allextended.slideUp();
 doIt = $extended.slideDown();
 } 
});​

AltStyle によって変換されたページ (->オリジナル) /