[SWFObject] Alternate CSS for alternate Content

Toby toby at creativefibre.co.uk
Tue Oct 10 07:55:39 PDT 2006


Woohoo!

 

Thank you very much, I am a complete JS newbie so it may take me a few trial
and error runs to integrate it but the information you have given me is
fantastic! Thank you very much!

 

Toby

 

  _____  

From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Aran Rhee
Sent: 10 October 2006 12:45
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] Alternate CSS for alternate Content

 

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/6c4d8623/attachment-0005.htm>


More information about the Swfobject mailing list