Why is my below preventDefault not working? can't seem to figure it out on this one
$(function() {
  $('a.action-link').bind('click', function(e){
    if(!$(this).hasClass('active')) {
      e.preventDef开发者_JAVA百科ault();
      $('#guts').fadeTo(333, 0.2);
      $('ul#slider').fadeOut(333, 'easeOutExpo', function() {
        $(this).fadeIn(333, 'easeInExpo');
      });
      return false;
    });
  }
});
Your brackets/parentheses don't match up. I'm not sure how any of it could work.
$(function() {
    $('a.action-link').bind('click', function(e){
        if(!$(this).hasClass('active')) {
            e.preventDefault();
            $('#guts').fadeTo(333, 0.2);
            $('ul#slider').fadeOut(333, 'easeOutExpo', function() {
                $(this).fadeIn(333, 'easeInExpo');
            });
            return false;
        }
    });
});
Seems that was only a syntax mistake:
      return false;
    });
  }
});
to
      return false;
    }
  });
});
This works as in the fiddle:
http://jsfiddle.net/UnahA/1/
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论