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 7047413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:46:06+00:00 2026-05-28T02:46:06+00:00

Here is what I have <div class=’class1′> Some content <div class=’trigger’> <a href=’#’>Push To

  • 0

Here is what I have

<div class='class1'>
   Some content
   <div class='trigger'>
     <a href='#'>Push To Start</a>
    </div>
</div>
<div ='toggle_content'>
   Show my content
</div>

Then I have a simple script that hides my toggle_content on load and another script:

$(".trigger").click(function(){
    $(this).toggleClass("active").next().slideToggle("slow");
    return false; //Prevent the browser jump to the link anchor
});

This works fine… If I move my trigger div next to the toggle_content, this is obvious by the next() function.

So the issue is how do I get it to work with the above structure? I’ve tried doing next(".toggle_content") but this simply sets the class of my trigger div to active and ends there, no magic toggle!

Any enlightenment to the voodoo unnatural world of jQuery would be appreciated.

  • 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-28T02:46:07+00:00Added an answer on May 28, 2026 at 2:46 am

    It looks like you want the next element relative to this element’s parent

    $(this).toggleClass("active").parent().next().slideToggle("slow");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
I have such div: <div class=box> <div id=myid style=display:hidden;> <p>some stuff here</p></div> </div> when
The esample is here: http://jsfiddle.net/SsPqS/ I have a div with class=record I add a
<div class=boxcontent> <div>some content this div may be missing [dynamic genrated]</div> <div class=elem></div> <div
I have this jsfiddle http://jsfiddle.net/fwQq4/19/ Here I have the wrapper class ( div.wrapper )
I have a div that contains 3 fields You can see the image here
I have this code here, {foreach from=$cart.cartItems item=item name=cart} <div id=cart2Produkt> <p>{if $item.Product.ID} <a
I have an architecture similar to this: <div id=container> <div>stuff here</div> <div>stuff here</div> <div>stuff
I have an html table. Here is a simplified version: <table> <tr> <td><div style=display:
assume I have a such html order <div id=header>>Header(logo, navigation menus etc)will be here,

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.