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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:02:55+00:00 2026-05-23T14:02:55+00:00

I have been having issues with getting .expander to work with divs that contain

  • 0

I have been having issues with getting .expander to work with divs that contain dynamic jQuery data (i.e. after the DOM is loaded). A user did recommend trying .live() and that has gotten me a step closer but it is creating some weirdness as illustrated in the images below.

I refer to a separate question in which https://stackoverflow.com/users/830804/eric suggested that I try .live():
How can I get the expander function to work with dynamic jQuery data?

NOTE: Slides 1-4 are located at my previous question here:

How can I get the expander function to work with dynamic jQuery data?

For Slides 5-6 see below.

SLIDE 5: The UI that uses .live() to create an exandable/collapsable div in each module

SLIDE 6: The result of clicking several times on the div… It adds multiple collapse links

SLIDE 7: The function that uses .live() to target dynamic jQuery data

Thanks for any advice you could offer.

Slide 5

Slide 6

Slide 7

  • 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-23T14:02:55+00:00Added an answer on May 23, 2026 at 2:02 pm

    Your initial answer is wrong. What you want to do is set up an expanded binding once the AJAX content is loaded, not on click. Here’s pseudo code.

    $.get('...' function(d) {
        $('#dynamiclongp').text(d).expander(...);
    });
    

    What’s happening is that .expander is getting called every time you click on the tags-hidden div. I’m not sure when you’re loading in your dynamic data, but you want to bind expander once, and only once, right after you set the content.

    If, for some reason, the AJAX callback function is not accessible, just make sure that you only bind your event once.

    var bound = false;
    $('div.tags-hidden').live('click', function() {
        if(!bound) {
            $(this).find('p').expander(...);
            bound = true;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some issues with getting my mouse events to work. I have a
I've been having issues getting a service to start. I have 2 other services
As many of you may already know I have been having issues with another
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
This is a really weird problem that I have been having. When I download
Originally, I was having some issues getting this code to function, but after a
I have been having a small problem that I can't by-pass it, I keep
Ok, I have been searching thick and thin, and I am having some issues
I have been having a heck of a time getting Udp sockets working correctly
I have been having this issue in iterating through an array of keys and

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.