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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:11:28+00:00 2026-05-26T13:11:28+00:00

I have a slider-like widget which is basically, a div of sub-divs containing some

  • 0

I have a slider-like widget which is basically, a div of sub-divs containing some page content (together with images).

Initially, all sub-divs are hidden except the main one.

My problem is that all web browser seem to load (request) all images in the content, whether they’re hidden or not.

In my case specifically, it will end up loading some 350 images at one go. This is a lot, especially when considering images are at the very least 200kb. In fact, the network log specifies that the total website size is in the range of 6mb to 7mb.

All these images hinder page load, especially because they are expected to load before other page elements (eg; buttons etc).

What is the solution to my problem? Things I tried already:

  • loading each sub-div as ajax. This is not possible, the page content must be there at all time.
  • hiding the images themselves (in the hope that the web browser does not load them). This failed, the browser still loaded images with CSS display:none;.
  • Possible solution: intentionally break the markup (server-side) so that the browser does not load the images, eg; writing <img alt="abc.jpg" src="about:blank"/>, then when tab switches, I would fix the markup correctly with jQuery. I haven’t tried this yet, is it advisable?
  • 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-26T13:11:29+00:00Added an answer on May 26, 2026 at 1:11 pm

    Well, as I hinted in the question, a possible solution can be achieved by the following trick:

    <?php
        // server-side content
        echo str_replace(' src=', ' data-dly="" src="blank.gif" data-src="', $html);
    ?>
    
    // client-side script
    function showPage(id){
        hidePages();
    
        var page = jQuery('#page'+id);
    
        page.find('img[data-dly="1"]').each(function(){
            jQuery(this).attr('src',jQuery(this).attr('data-src'));
        }).removeAttr('data-dly').removeAttr('data-src');
    
        page.fadeIn();
    }
    

    NB: Thanks to @jeffreydev for the help as well.

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

Sidebar

Related Questions

I'm trying to create a jQuery widget which extends from ui.slider . I'd like
I have a Jquery - UI slider like this the HTML <div id=slider1 class=slider></div>
I have a slider that's marked up like so: <div class=slider wide> //slider html
I'm using JQuery's slider widget with non-linear values. Basically, I have my slider set
I'd like to have a slider (lets say values from 0 to 4) and
I have two range sliders in my page, and I would like to implement
I have a slider that has a fade-in and fade-out transition. It basically cycles
I have an slider animation but on clX.click event #close div hides before it
I have a slider on my page. What I want to do is, to
let's say I have a jQuery UI Slider like so: $(.mySlider).slider({ range: min, min:

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.