Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CSS (display: none;)



Hey,

First of all: Sorry if this isn't the right forum?

I've been playing around with the display: none; css property.

It seemed that using this property was a good alternative to javascript wrt. preloading images. This is my code:

----------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Preload test</title>
    <meta name="author" content="Jeppe Utzon, http://www.utzon.com/"; />
    <meta name="generator" content="BBEdit 7.1.4" />
    <meta name="description" content="Preload test page" />

<style type="text/css" media="screen"><!--

    img.preload {
        display: none;
        }

--></style>

</head>

<body>
<p>Wait for page to load completely - then click <a href="large.jpg">here</a> to view the (preloaded) image.<img src="large.jpg" width="1536" height="864" class="preload" alt="Preload image" /></p>
</body>

</html>

----------------------------------------------------

And it's hosted here:

<http://www.utzon.com/preload/>

Please make sure the page loads completely (including the display: none; image) before you click the link.

It works as expected in Gecko-based browsers, but Webcore/Safari doesn't load content which has been tagged with the display: none; property. It seems to me that Gecko's way of handling this is the correct way and I filed a bug report on this to Apple. But then I had doubts and thought I'd let people on this list know about it wrt. which of the two approaches (Gecko's vs. Webcore's) you feel is the correct one.

Cheers, jeppe Utzon
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.