Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8870803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:49:40+00:00 2026-06-14T17:49:40+00:00

I created this fiddle from code found on Stack, but it is firing an

  • 0

I created this fiddle from code found on Stack, but it is firing an error. Can you help please.

My Fiddle: http://jsfiddle.net/422steve/DVNGc/

Original anser : https://stackoverflow.com/a/13000179/501173

Error I am getting is: TypeError: $allExtended.slideUp() is not a function

js:

$('.holder').on('click','a',function(e){   
    e.preventDefault();
    var $allExtended = $(this).closest('.wrapperdoo').find('.extended'),
        $extended = $allExtended.eq( $(this).index() ),        
        doIt= ($extended.is(':visible')) ? $extended.slideUp() : ($allExtended.slideUp()) ($extended.slideDown());   
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:49:41+00:00Added an answer on June 14, 2026 at 5:49 pm

    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();
        }  
    });​
    

    — EDIT —

    To add the class to the href that is being clicked, just do it like this, in the function:

    $(this).addClass('class');
    

    If you want to remove the class when you are done, do it like this. First, assign the this variable as a global variable (so the this variables don’t get mixed up), like so:

    var sender = $(this);
    

    Then, in your slideUp() or slideDown() functions, the second parameter is a callback for when it is completed:

    $allextended.slideUp(500, function() { sender.removeClass('class'); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

starting from existing fiddle, I've created this sample: http://jsfiddle.net/2DaR6/90/ Here's the html code: <div
In this fiddle http://jsfiddle.net/dAHqe/2/ I've created examples for the 2 main uses (that I've
I have created a fiddle to test this : http://jsfiddle.net/Ninjanoel/X6ShS/ which works fine :(
This isn't a javascript question but I've created a fiddle so I can demonstrate
I've created a fiddle here: http://jsfiddle.net/surfjam/zWWpz/ I can't figure out why animate works in
I have created this Fiddle with this code: This is my problem I want
Consider this jsfiddle: http://fiddle.jshell.net/maple/JbEJN/show/ (this is the result window, in order for replaceState to
With this fiddle http://jsfiddle.net/mungbeans/f2ne6/2/ why is the opacity undefined when accessed in js when
In this fiddle http://jsfiddle.net/5L8Q8/28/ , if you click the black button, it randomly selects
I created this example The remove function doesn't work, and I can't figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.