swf in header with css?
- Started
- Last post
- 12 Responses
- eegrek
I've styled a site using css and in the 'header' area I have an image. Now the client wants the image animated using flash. I can't call the flash from the css file can I? Am I going to have to insert the flash file in each html page?
- amullins0
it depends on the html. if you can target the header specifically with a css selector like div#header, you will be able to use js to output the flash object. do you have a js file included on each page (this would make it much simpler)?
- eegrek0
I do have a #header, my image was the background of that.
- amullins0
do you have a js file included on each page?
- eegrek0
not yet, but I'm going to need one for the flash either way right?
- amullins0
yes - swfobject will work fine if you're not using another js library/framework.
d/l from http://code.google.com/p/swfobje… svn checkout recommended.
follow the instructions here http://code.google.com/p/swfobje…
the initial content in #header will be replaced with the flash object - i'd recommend leaving the existing content for seo/accessability purposes - esp if it includes the site nav.
- eegrek0
It just was a header image. I'll check it out and try figure out how to put that code in to css. Thanks so much man!!
- amullins0
n/p - feel free to email me with Qs as I probably won't be checking this thread again.
- yaphi0
I second slappy's post, but not ssi specifically. I rarely do anything that doesn't have an included header file for the <head>, etc. That way I can control javascript / css files for an entire site in one file. Which would help tremendously in this situation.
- eegrek0
It worked in Safari on a mac!! Thanks so much amullins!!
- amullins0
n/p - as yaphi and slappy mentioned above, ssi is the way to go for new projects (if your host supports them). they make updates like this fast-n-easy. i generally have the following includes for a simple site:
head.include.php - meta. scripts, css, etc.
header.include.php - header w/ main nav
footer.include.php - footer nav and copyright
subnav.include.php - if necessary
breadcrumb.include.php - if necessary
- eegrek0
you lost me at 'ssi' but I will definitely research more. I'm a recent "print" convert to the web thing but I get the jist of what you are talking about. Thanks again for your help.