browser javascript to detect if the browser is MAC Firefox and to load a gif

They have: 3 posts

Joined: Jun 2008

I need an inline browser javascript to detect if the browser is MAC
Firefox and to load a gif. If not mac firefox load an SWF.

eg:

detect if Mac firefox if yes load src="/content/flash/WYD03.gif"

if other browser load src="/content/flash/WYD03.swf"

is this possible?

I would need it to be in the code NOT in the header as there are
several swf's on one page and Mac Firefox is making the SWF on top of
all other divs therefore not displaying the divs.

see the problem here http://www.beamcreative.com/menutest.aspx

index does not work with .swf files. I have a work around for all
other browsers but Mac/Firefox has a bug that prevents SWF files to be
at the bottom layer.

They have: 17 posts

Joined: Jun 2008

First of all, why are you hosting on windows. ewwwww! Laughing out loud

Secondly, that flash image thing that changes colours could be done in dhtml.

Thirdly, i would say use browser sniffing only as a last resort.

I've just looked at it on my mac and the menu expands to half way down the .swf file, could you not put the menu and swf file in separate containers then use z-index so that the extended menu actually flows over the .swf file? If you could post the code for the menu and the container for the .swf file it would be a lot easier to help you.

If it were me, i would ditch the flash and build a new menu but that's just me.

They have: 17 posts

Joined: Jun 2008

Just had a look at your site properly, instead of using browser sniffing why don't you ditch the flash on the front page and make something that does the same thing in dhtml?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

andrewtaylor, that is not the question...

have a look here at w3schools for navigator DOM objects

I generally do an indexOf(navigator.userAgent,"some string"); to check for platform, browser etc. it might help if you first assign somevariable = navigator.userAgent;

In Windows Firefox the UA is Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.