I'd suggest this from a progressive enhancement mindset:

1. always put in your HTML markup the container div you are talking about, 
surrounding your replaceable alternate content.
2. have it styled by default to look correctly for your alternate content.
3. have your javascript call to embedSWF in your document as normal
4. loop/wait/detect the successful embedding of the SWF, and once that 
occurs, add a class attribute to your container div which gives it the 
desired flash container styling you want.

The "difficult" part is the embed detection.  In v2.2 of our library, there 
will be a direct callback to detect this event, but right now, you'd 
basically have to just set a quick-running timer to loop looking for if the 
alternate content is still there or not, and as soon as its gone, apply the 
class as stated in step #4.

---------
More exotically, but probably not best practice and certainly less robust, 
you could consider:

1. "Detect" that embed event, and dynamically insert a parent div to "wrap" 
the swf object.
2. hack the library's embed-swf method to include the "<div>" markup in 
whatever it sends to the dom.

--Kyle




--------------------------------------------------
From: "st" <[email protected]>
Sent: Wednesday, February 11, 2009 6:41 AM
To: "SWFObject" <[email protected]>
Subject: swf specific container div

>
> Hi,
>
> Using the swfObject dynamic method.
>
> Would like swfObject to also generate a ‘swf-only’ container <div> for
> the <object> tag as css styling for the <object> tag does not work
> well across all browsers… e.g. borders in Firefox and padding in IE
> etc.
>
> Appreciate that I can add an extra wrapper <div> direct to the html
> page but do not want the swf specific styles to affect the alternate
> content should javascript/flash be disabled.
>
> I have added extra html in the swfObject code here...
>
> v.outerHTML='<div id="swfOnlyWrapper"><object classid="clsid:D27CDB6E-
> AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object></div>";
>
> ...and this works for IE browsers but ideally want a container <div>
> that applies to all browsers.
>
> Can you help?
>
> Regards
>
> >
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to