Thanks everyone, I appreciate the suggestions. I am indeed wrapping
this in a nested div. There are two div levels #main and #media. The
media div is what SWFObject replaces, and the print CSS for that is:
#media {
display: none;
}
I can't hide the main div as that contains all the other content as
well, but Philip's post made me wonder about the ID. It turns out
that I had SWFObject's attributes.id parameter set to a different
value than the container div ID. Once I set it to "media," the print
CSS worked perfectly. For some reason I thought SWFObject maintained
the same ID as passed to swfobject.embedSWF.
Thanks for leading me on to this!
On Jan 28, 1:05 pm, Philip Hutchison <[email protected]> wrote:
> SWFObject 2.x replaces the targeted <div> with an <object>, so you have to
> be careful how you write your CSS.
>
> If you use pure IDs and no tag names, you should be able to do this:
>
> Pre-embed:
> <div id="flash">SWF will go here</div>
>
> Post-embed:
> <object id="flash"></object>
>
> With this CSS in your print stylesheet:
> #flash { display: none; }
>
> If you tried using div#flash {display: none; }, it would fail because the
> element is no longer a div. Also, as Sam implied, if you're wrapping
> everything in an additional <div>, you can just target the wrapper:
>
> Pre-embed:
> <div id="wrapper">
> <div id="flash">SWF will go here</div>
> </div>
>
> Post-embed:
> <div id="wrapper">
> <object id="flash"></object>
> </div>
>
> With this CSS in your print stylesheet:
> #wrapper { display: none; }
>
> - philip
>
>
>
> On Thu, Jan 28, 2010 at 8:24 AM, Nathan Mynarcik <[email protected]> wrote:
> > what is your css for your print media stylesheet?
>
> > Nathan Mynarcik
> > Interactive Web Developer
> > [email protected]
> > 254.749.2525
> >www.mynarcik.com
>
> > -----Original Message-----
> > From: rollingsj <[email protected]>
> > Date: Thu, 28 Jan 2010 06:13:54
> > To: SWFObject<[email protected]>
> > Subject: Hide SWFObject DIV for print media
>
> > I'm relatively new to SWFObject, and am having an issue with the print
> > media styles in IE7. Essentially, I'm hiding the DIV that SWFObject
> > uses in my print style sheet. This works fine in FireFox 3.5.7 (i.e.
> > it hides the DIV element and the swf is not shown on the printed
> > page), but in IE7 the swf is still shown when printing.
>
> > Does anyone have a way to correct this issue?
>
> > Many thanks.
>
> > --
> > 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]<swfobject%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/swfobject?hl=en.
>
> > --
> > 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]<swfobject%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/swfobject?hl=en.- Hide quoted text -
>
> - Show quoted text -
--
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.