Kyle,
Thanks for quick response.
>From a progressive enhancement point of view I would suggest that
adding an extra <div> to the html markup is not needed as we already
have the <div> in place to style the alternate content. For example we
have…
<div id=”myContent”>
<p>alternate content here…</p>
</div>
We then style the alternate content accordingly in this example using
<div id="mycontent">. If javascript/flash installed, then swfObject
removes both this <div> and its content and replaces it with just the
<object> tag (with no container <div>).
All well and good, but as mentioned some browsers have css styling
issues with the <object> tag… which leads to my request for a swf-only
container <div> to give us more control. I would suggest that it is
dynamically added along with the <object> tag and not before, because
if we add the <div> to the original html markup then we are
introducing an extra unnecessary <div> to the code…
<div id=”swfWrapper”>
<div id=”myContent”>
<p>alternate content here…</p>
</div>
</div>
swfObject will remove the inner <div id="myContent"> and its content,
but if swfObject does not come in to play, then we have a doubling up
of <divs>. We only need the swf wrapper if we get the swf movie.
Accordingly, I would rather go down the route of your second option,
adding it dynaically, and would be grateful if you could recommend how
to go about your second option.
Regards
Getify Solutions, Inc. wrote:
> 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
-~----------~----~----~----~------~----~------~--~---