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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:24:57+00:00 2026-06-18T10:24:57+00:00

Pretty simple question: Can I force a browser to not download any images or

  • 0

Pretty simple question:

Can I force a browser to not download any images or other resources if they are display:none, but then, of course download when display is switched to inline?

Here is the concept: A lecture presentation with many slides as images all set to display:none by default then changed to display:inline when the video reaches a certain time index. The browser still tries to load all of the images even though they are not displayed which might cause a hang on the video or elements that should load after the slide images.

I have a series of these:

<figure class="lectureNotCurrent" data-start="0" data-end="259">
<a href="img1_large.JPG" target="_blank">
<img src="img1_large.JPG" class="lectureSlidesImg" /></a></figure>

EDIT – SHOULD WORK?

<img data-src=/path/to/img.png src="">

//js
loadNextImages() {
   document.querySelectorAll("#slidesContainer footer").map(function () {
       this.getElementsByTagName('img').src = this.getElementsByTagName('img').dataset.src;
       delete this.dataset.src;
   });
}
  • 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-18T10:24:58+00:00Added an answer on June 18, 2026 at 10:24 am

    Here is what I ended up doing.

    HTML

    <figure class="lectureNotCurrent" data-start="0" data-end="259">
    <a href="img1_large.JPG" target="_blank">
    <img data-src="img1_large.JPG" src="" class="lectureSlidesImg" /></a></figure>
    

    In the function that runs the timings for the slides I added the variable:

    var imgNames = document.getElementsByClassName('lectureSlidesImg');
    

    I then added this statement in the section of code (a ‘for’ loop) that applies display:inline to the figure tags at the correct moments according to the video’s current time.

    imgNames[i].src = imgNames[i].getAttribute('data-src');
    

    So in addition to displaying the figure tag in question it will also take the data-src value for the image in question and insert it in the src attribute. The image then loads.

    There is a lot of power behind the data-* custom attributes. Glad I learned about those.

    One would think, however, that display:none should prevent loading the content unless the display is changed.

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

Sidebar

Related Questions

my question is pretty simple: can PHP and Java communicate, while PHP being the
My question is pretty simple: How can I write a function once and make
I have a pretty simple question: how can I terminate a running script in
This is a pretty simple question- how can I check if a NSURL is
This is a pretty simple question that I can't quite get my head around.
This is probably (hopefully) a pretty simple question, but I can't seem to get
I have a probably pretty simple question but I am still not sure! Actually
This is actually a pretty simple question but I can't seem to find the
Pretty simple Question, unfortunatly never used draw controls etc in C# so im not
I can't find an answer one way or the other for this. Pretty simple

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.