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 have a slider that's marked up like so: <div class=slider wide> //slider html
I have the following code which I got from http://css-tricks.com/startstop-slider/ I would like to
I have the following code which I got from http://css-tricks.com/startstop-slider/ I would like to
I have an slider animation but on clX.click event #close div hides before it
I am creating a portfolio page for m personal site. I have a slider
I am creating a portfolio page for m personal site. I have a slider
I have a databinding problem in WPF. I would like to customise a slider
I want to create a slider with images like a control in the bottom
I have a side panel like widget in my app that can be swiped
I have created a basic unlock slider like you use to unlock the iPhone.

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.