Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Does an image inside of display: none still load in the background?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason C  
View profile  
 More options Jul 31 2012, 5:04 am
Newsgroups: comp.infosystems.www.authoring.stylesheets
From: Jason C <jwcarl...@gmail.com>
Date: Tue, 31 Jul 2012 02:04:56 -0700 (PDT)
Local: Tues, Jul 31 2012 5:04 am
Subject: Re: Does an image inside of display: none still load in the background?

On Tuesday, July 31, 2012 3:28:12 AM UTC-4, Jukka K. Korpela wrote:
> ... the page should be constructed e.g. so that its <img> tags have fake

> src attributes, or no src attributes at all, and these attributes are

> changed or added when additional images are to be shown. You can't do

> such things in CSS, you need some client-side scripting, or you need to

> divide the material to different pages.

Based on this logic, would it not be acceptable to create an empty DIV in place of the image, and then set a background-image dynamically at the same time that I change the display style?

Something like:

<div id="img_12345" style="display: none; height: 75px; width: 75px"></div>

// Javascript
function whatever() {
  document.getElementById('img_12345').style.backgroundImage=
    "url(whatever.jpg)";

}
> On the other hand, the approach results in suboptimal user experience.

> There would be a delay when moving from one set of images to another. A

> better approach could be (if you expect the image sets to be viewed

> sequentially) to have the next set of 50 images downloaded

> asynchronically on the background. But this takes us rather far from CSS.

Excellent point. They would be viewed sequentially, so loading the next 50 while viewing the current 50 is a very good suggestion.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.