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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:17:26+00:00 2026-06-15T13:17:26+00:00

I have a div that I’m loading a slider into with the .load. For

  • 0

I have a div that I’m loading a slider into with the .load. For some reason once I’ve loaded the slider into the div I can’t clear it out. I’m trying to use the jquery empty() function but it won’t work. The js I’m using to load the slider in is:

$("#nav").click(function() {
    $("#info_header").empty();
    $("#content_1").empty();
    $("#content_2").empty();
    $("#content_3").empty();
    $("#images").empty();
    $("#load_container").switchClass("load_container_port", "load_container_slider", .01);
    $("#controls").switchClass("controls_port", "controls_slider", .01);
    $("#info").switchClass("info_port", "info_slider", .01);
    $("#load_container").css({
        height:($(window).width() * 500) /1000
    });
    $("#info").css({
        height:($(window).width() * 500) /1000
    });
    $("#top_section").css({
        height:(($(window).width() * 500) /1000) + 40
    });
    setTimeout(function() {
        $("#slider").delay(100).load("home_slider.html"); 
    }, .03);       
});

and then the js I’m using to try empty and load new content in is:

function portfolio_clear() {   
    $('#slider').empty(); 
    $("#images").empty();
    $("#load_container").switchClass("load_container_slider", "load_container_port", .01);
    $("#controls").switchClass("controls_slider", "controls_port", .01);
    $("#info").switchClass("info_slider", "info_port", .01);
}


$("#space").click(function() {

    $('#load_container').css({
        background: "#191919"
    });
    $('#close_white').css({
        display: "inline-block"
    });
    $('#close_black').css({
        display: "none"
    });
    $('#goto_white').css({
        display: "inline-block"
    });
    $('#goto_black').css({
        display: "none"
    });

    var id = $(this).attr('id');

    $("#info_header").load(id + "_header.txt");
    $("#content_1").load(id + "_1.txt");
    $("#content_2").load(id + "_2.txt");
    $("#content_3").load(id + "_3.txt");

    $("<img>", {
        src: "http://www.klossal.com/space.jpg"
    }).appendTo("#images");

    $('html, body').animate({
        scrollTop: 0
    }, 300);

    if (screen.width >= 1025) {
        $("#top_section").animate({
            height: 1112
        }, 300);
    }
    else {
        $("#top_section").animate({
            height: 926
        }, 300);
    }

});

the page can be viewed here:

“http://173.254.28.83/~klossalc/index_test.html&#8221;

you can load the slider by clicking klossal.com in the very upper left hand corner, and you can try to click on the first tile below to try to replace it, which won’t work. If you click on the tiles first they load fine, and then clicking klossal.com to load the slider also works, just not the other way around.

  • 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-15T13:17:27+00:00Added an answer on June 15, 2026 at 1:17 pm

    I would use this to clear an elements html:

    $("#element_id").html('');
    

    I cant see where you are calling portfolio_clear() from, if you want it to happen when you click your thumbnails try this:

    $(".thumb").click(function() {
            portfolio_clear();
            $(".thumb_info").not(this).switchClass("info_color_3", "info_color_2", 300);
            $(this).find('.thumb_info').switchClass("info_color_2", "info_color_3", 300);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div that expands on a click, but I can't work out
I have a div that I click on to drag it. Once it's on
I have a div that is rectangular with some cute rounded corners. This is
I have a popup div that I need to load a bunch of different
I have a div that contains some html and a lot of Javascript <div
I have Div that it contains some other elements like <p> , <ul> ,...
I have this div that can be dragged vertically off the screen. I want
I have some DIV that fades in by clicking another DIV trigger element. I
I have some DIV that fades in by clicking another DIV trigger element. I
I have a div that expands to the height of it's content. It works

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.