[SWFObject] Alternate CSS for alternate Content

Aran Rhee aran.rhee at qdc.net.au
Tue Oct 10 04:44:50 PDT 2006


Toby.
 
When you call so.write() it returns true or false depending on whether the
user has the correct version of flash or not.

so = new SWFObject(....
...
if (so.write("flashcontent")) {
// do flash stuff
} else {
// do alternate content stuff
}
 
You can use the attached js/demo example to do the swapping of the css based
on flash or not. The basis is that by adding the rel= alternative and adding
a title param, the css will not be displayed until you swap to it. There is
some extra trickery of using a cookie to remember the last selected
stylesheet, but you will most likely want to omit this functionality (remove
the onLoad and onunload functions from <body
onload="useStyleAgain('styleTestStore');"
onunload="rememberStyle('styleTestStore');">)
 
e.g.
 
<link rel="alternate stylesheet" type="text/css" href="extraPretty.css"
title="Pretty">
 
BTW - original swap code / demo is courtesy of Mark Wilton-Jones from
howtocreate.co.uk <http://www.howtocreate.co.uk/> 
 
 
Cheers,
Aran


  _____  

From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Toby
Sent: Tuesday, 10 October 2006 8:00 PM
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] Alternate CSS for alternate Content



Bump.

 

Anyone have a solution for this? Or am I trying to do something a bit wrong
that nobody is interested in?

 

Cheers!

Toby

 

 


  _____  


From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Toby
Sent: 06 October 2006 11:55
To: swfobject at lists.deconcept.com
Subject: [SWFObject] Alternate CSS for alternate Content

 

Hi list,

 

I have seen this covered before but I haven't been satisfied with the
information available to integrate it. Mainly through my lack of any JS
knowledge admittedly and the solution I found on the homepage was posted for
a previous version of SWFObject. Has anyone done this successfully with the
latest version of SWFObject? Or is there a snippet of JS a fool like myself
could integrate into the current version?

 

Cheers!

Toby

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20061010/cced915c/attachment-0005.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swap_css.zip
Type: application/x-zip-compressed
Size: 3926 bytes
Desc: not available
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20061010/cced915c/attachment-0005.bin>


More information about the Swfobject mailing list