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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:35:52+00:00 2026-06-02T06:35:52+00:00

I have been trying to manipulate content that is loaded into jQuery UI tabs

  • 0

I have been trying to manipulate content that is loaded into jQuery UI tabs via AJAX.
As you can imagine, these elements are “future” DOM elements and aren’t manipulated by normal $(“.someClass”)functions.

I’ve read using .live() for event handling is now deprecated using jQuery 1.7+ and is replaced by the new .on() method.

My issue is that the div I want to hide, when it loads in an AJAX tab, must be manipulated after the initial DOM load and is not bound to a click event at first.

My functions, which are currently wrapped in $() are below.

I think I have the syntax correct for links that use a click handler, but I’m not sure of the correct way to “.hide()” my “hiddenStory” div at load.

I also think that the functions themselves shouldn’t be wrapped in an overall $()?

Any help or advice would be greatly appreciated.

$(function(){
    // this .hiddenStory div below is what I want to hide on AJAX load
    // need syntax and/or new methods for writing this function
$(".hiddenStory").hide();

   // this is a function that allows me to toggle a "read more/read less" area
   // on the "hiddenStory" div
$(".showMoreOrLess").on('click', (function() {
if (this.className.indexOf('clicked') != -1 ) {
    $(this).removeClass('clicked');
    $(this).prev().slideUp(500);
    $(this).html("Read More" + "<span class='moreUiIcon'></span>");
    }
    else {
    $(this).addClass('clicked');
    $(this).prev().slideDown(500);
    $(this).html("See Less" + "<span class='lessUiIcon'></span>");
    }       
}));
});

// prevents default link behavior 
// on BBQ history stated tab panes with    
// "showMoreOrLess" links
$('.showMoreOrLess').click(function (event) 
{ 
 event.preventDefault(); 
 // here you can also do all sort of things 
});
// /prevents default behavior on "showMoreOrLess" links  
  • 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-02T06:35:54+00:00Added an answer on June 2, 2026 at 6:35 am

    Could you set the display: none via CSS and override it when you wanted to show the element’s content? Another option, if you have to do it this way would be to add the `$(“.hiddenStory”).hide() in the callback from the AJAX load that is populating the element. For example:

    $(".hiddenStory").load("http://myurl.com", function(){
            $(".hiddenStory").hide();
        }
    );
    

    If you aren’t using the .load method, you should have some sort of call back to tie into (e.g. success if using $.ajax…)

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

Sidebar

Related Questions

I have been trying to create a Main program that calls another program, sending
Sorry if this sounds childish. I have been trying to manipulate a canvas element
I've been trying to implement unit testing and currently have some code that does
I have been trying to manupulate registry key from python using the win32api module
Have have been trying to make a validator for my xml files. I have
I have been trying this for the whole day and I managed to make
I have been trying to get a response from a server sending a GET
I have been trying real hard understanding regular expression, Is there any way I
I have been trying to figure out the following excerpt from Ruby on Rails
I have been trying to access an HTTPS URL with the HTMLUnitDriver API of

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.