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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:03:23+00:00 2026-06-14T07:03:23+00:00

I have issues when trying to place an event to toggle a div using

  • 0

I have issues when trying to place an event to toggle a div using an element outside of the parent container.

I trying to target the same behavior from outside of the parent elements using a span tag.

Any help would be grateful.

HTML:

<div class='toggle_parent'>
    <div class='toggleHolder'>
      <span class='toggler'>Open</span> 
      <span class='toggler' style='display:none;'>Close</span>
    </div>

    <div class='toggled_content' style='display:none;width:100%;height:400px;'>
        <h2>Hello This Is My Content Right Here</h2>
        <span class='toggler btn btn-large'>Close</span>      
    </div>
</div>



 <!-- I need this element to trigger from outside -->
 <span class="toggler btn btn-large btn-info">Gain Early Access</span>

Javascript:

$('.toggler').live('click',function(){
/*   $(this).parent().children().toggle();  //swaps the display:none between the two spans */
$(this).parent().parent().find('.toggled_content').slideToggle();  //swap the display of the main content with slide action

});
  • 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-14T07:03:24+00:00Added an answer on June 14, 2026 at 7:03 am

    Amended your example to suit the purpose.

    <div id="container">
        <div>
            <div>
              <span class='open'>Open</span> 
              <span class='close' style='display:none;'>Close</span>
            </div>
    
            <div class='content' style='display:none;width:100%;height:400px;'>
                <h2>Hello This Is My Content Right Here</h2>
                <span class='close'>Close</span>      
            </div>
        </div>
        <!-- I need this element to trigger from outside -->
        <span class="toggle">Gain Early Access</span>
    </div>
    
    $(".toggle").click( function( ) {
        $(".content").slideToggle();
    });
    $(".open").click( function( ) {
        $(".content").slideDown();
    });
    $(".close").click( function( ) {
        $(".content").slideUp();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div element that I'm trying, basically, to move wherever the user
I have performance Issues when trying to load a list of contacts. this is
I am trying to load an image in memory but might have memory issues
I have been have issues trying to retrieve the values from a treeMap that
Using PHP, and MySql, I am trying to implement this rather snazzy in-place editor
I'm trying to edit the 'onchange' event of an existent 'select' element. For example
I'm trying to write to the Windows Event Log and I have a nagging
I have this issue trying to get all the text nodes in an HTML
I have ran into an interesting issue while trying to create a more usable
I have an issue with psql. I am trying to select the records from

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.