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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:57:00+00:00 2026-06-16T19:57:00+00:00

I have a script that load content from another page into a div based

  • 0

I have a script that load content from another page into a div based on options in selectbox. I wounder if its possible to add a slide effect when the content gets loaded into the div.

The script looks like this:

$(document).ready(function(){ 
    $("#selectbox").change(function(){ 
    var selectedOption = $('#selectbox :selected').val(); 
    $containerDiv = $('#div_that_recieves_content'); 
    $containerDiv.html("");
            switch (selectedOption)
            {
            case "Option1":$containerDiv.load( "page.html #div" , function(){$(document).trigger("reload");});break;
            case "Option2":$containerDiv.load( "page.html #div" , function(){$(document).trigger("reload");});break;
            case "Option3":$containerDiv.load( "page.html #div" , function(){$(document).trigger("reload");});break;
            }
    return true;
    }); 
});

Thanks.

  • 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-16T19:57:01+00:00Added an answer on June 16, 2026 at 7:57 pm

    The callback of load() fires when the new content is available. You could hide container before the AJAX, and slide it down once AJAX is complete

    $containerDiv.html("").hide();
    

    Then in switch you would do better to only use cases to define URL, and only call load() once:

    var url;
    switch (selectedOption) {
            case "Option1": url= "page.html #div";break;
            case "Option2": url= "page.html #div";break;
            case "Option3": url="page.html #div" ;break;
    }
    
    $containerDiv.load( url , function(){
        /* new content exists, can display it now*/
         $(this).slideDown();
         /* no idea what "reload" does.. if it affects "$containerDiv" may need to do slideDown in that handler*/
         $(document).trigger("reload");
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that drops a load of tables using DROP TABLE IF
I have a script on jquery that load some site in iframe using: $(#demo_frame).attr('src',
I have a script that I want only to load if a certain condition
I have created an R script that it needs to load some libraries first.
I have a java script function that i have called on body load mousemove()
I have script that reads remote file content and writes it to local server.
I have these pages: information.php <div id='content'>Foo Bar</div> main.php <div id='main'></div> <script type=text/javascript> $(document).ready(function()
I'm new to PHP and stackoverflow. I created a script that takes content from
I have numerous iframes that load specific content on my pages. Both the parent
I'm trying to have navigation buttons on my page load content files, but a

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.