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

  • Home
  • SEARCH
  • 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 4254616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:06:30+00:00 2026-05-21T05:06:30+00:00

I am afraid I similar question might be already asked somewhere, but I wasn’t

  • 0

I am afraid I similar question might be already asked somewhere, but I wasn’t able to find a solution.

Here’s roughly my environement + purpose:
I have a very simple HTML JQuery Setup whose intent is do collapse the later content when a page has more than 5 h3’s. Each h3 is followed by 1 or more paragraphs. If a page does have more than 5 h3’s every content belonging to the h3 should be automatically collapsed (hidden), shown when the corresponding h3 is clicked and hidden, when clicked again.

Here’s my jquery code:

$(document).ready(function() {

if ($('h3').length > 4) {
    var headlines = $('h3').slice(3);
    var start = $('h3').slice(3,4);     
    var content = start.nextAll().not('h6');

    headlines.addClass('expandable-headline');
    content.hide(); 

    headlines.click(function() {        
        var successors = $(this).nextUntil('h3');
        successors.toggle();
        $(this).toggleClass('expandable-headline');
    }); 
}
});

Here’s my html:

< h3>ABC</h3 >  
< p>some nice content</p >
< h3>ABC</h3>
< p>some nice content</p>
< p>some even nicer content</p>

Last but not least, here’s my problem:

All code above works perfect when run locally in simple test files, but when I try it inside my production system (a Drupal site) it throwns an error at

 var successors = $(this).nextUntil('h3');

stating, that $(this).nextUntil is not a function.

Any ideas, what this is about?

I appreciate any help.
Best Greeets,
Sunny

  • 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-05-21T05:06:31+00:00Added an answer on May 21, 2026 at 5:06 am

    Are your versions of jQuery the same?

    To test this, insert this line of code somewhere into your script on each page:

    alert(jQuery.fn.jquery);
    

    It’ll alert() your version number.

    If your search the jQuery changelog for nextUntil, you’ll see that it was added in version 1.4, so your Drupal jQuery version might be old.

    If you are planning on upgrading jQuery (I don’t use Drupal. WordPress works fine for me), this question seems relevant: Drupal 6: best way to upgrade jQuery?.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm afraid very similar question has been asked already here , but for some
I'm sorry, I'm sure a similar question has already been asked but I'm afraid
I am afraid this question is not supposed to be asked here but I
I'm afraid I may be asking a stupid question here, but my google-fu seems
A slightly archaic question I'm afraid but here goes: I have a program which
This question has been already asked, but never answered. I want to write some
I'm afraid I'm at a loss here, I checked out some similar questions but
I realise there are some similar questions on here already but I couldn't see
I asked a very similar question earlier today, so you might get a bit
(This question is similar to this one , but it's for using XMLHttpRequest instead

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.