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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:26:07+00:00 2026-05-25T02:26:07+00:00

I am having trouble getting my div to slide smoothly upon the View Activity

  • 0

I am having trouble getting my div to slide smoothly upon the “View Activity” text being clicked. What I wish to achieve is this:

  • When the “View Activity” link is clicked, I want the div to slide open smoothly
  • Once full open, the div should display “Loading…” until the content is fully loaded
  • Once the content is fully loaded, it should replace the “Loading…” text inside the div

What really happens

  • When the “View Activity” link is clicked, the div suddenly opens and then instantly closes
  • If I click the link once more it slides open normally and slides closed smoothly when clicked again

How do I make it slide open smoothly the first time and load the content smoothly while this happens? I suspect this has something to do with the content of div being changed while sliding, but I have no idea how to fix it.

HTML

<div class="listing_activity_container">
   <span style="cursor: pointer;" class="listing_activity_link <?php echo $listing->listing_id ?>">View Activity</span>
   <div class="activityContent_<?php echo $listing->listing_id ?>"></div>
</div>

JQUERY

<script>

    $(document).ready(function(){
       $(".listing_activity_link").click(function()   {
            var listing_id = $(this).attr('class').split(' ')[1]
            var url = "<?php echo site_url('AJAX/ajax_default/listing_activity_seller'); ?>";

            $(".activityContent_"+listing_id).slideToggle();
            $(".activityContent_"+listing_id).html('Loading...');
            $.post(url, {listing_id: listing_id} ,function(data) {
               $(".activityContent_"+listing_id).html(data);
            });
       });   
    });

</script>
  • 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-25T02:26:08+00:00Added an answer on May 25, 2026 at 2:26 am

    Use animate and register a complete callback:

    $(".activityContent_"+listing_id).animate({"height":100}, { complete: function(){
        $(".activityContent_"+listing_id).html('Loading...');
        ...
    }});
    

    This code will be executed after the animation has finished.

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

Sidebar

Related Questions

ok so im having trouble getting this to work. nothing is happening. view the
I'm having trouble getting this <div> to automatically update using jQuery. It's essentially a
I am having trouble getting a background-image to overlay the border of another div.
I'm trying to fit three images inside a div, but I'm having trouble getting
I'm having a bit of trouble getting a certain div to show onclick. Any
I'm having trouble getting the elements in my <div id=wrapper> to push down my
I've done this before, but I'm having trouble getting this to work... I need
I'm having trouble getting jQuery to allow only one content-DIV to be visible at
Having trouble getting the following code to work: $('#changeMode').button().click(function(){ $('#playfield').toggle(function() { $(this).switchClass(gridView,plainView); }, function()
I'm having trouble getting some text to pulsate using the jquery UI plugin in

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.