Forum Moderators: open

Message Too Old, No Replies

how to detect safari then replace swf with jpg

         

tonyledenko

4:40 pm on Mar 17, 2009 (gmt 0)

10+ Year Member



I was wondering if there is a way to detect if a browser is safari then do the following:

1. If safari show jpg in a div
2. If not safari show swf in a div

Thanks in advance

PHP_Chimp

5:02 pm on Mar 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




var agt = navigator.userAgent.toLowerCase();
if (agt.indexOf("safari") != -1) {
// is safari
}
else {
// not safari
}

Generally I would have to say not to try using the method above, as not all browsers identify themselves correctly...and browser detection is just so 1999 ;)

So it would be better to try and find out what the problem that safari are having and work around it.
However that is not always possible, so the above may work for you in the short term.

tonyledenko

5:08 pm on Mar 17, 2009 (gmt 0)

10+ Year Member



The problem I am having with the flash is as follows:

I have a css menu above it, when the menu is mouseovered the flash below it disappears until mouseout of the menu.

Also the wmode=transparent does not work in safari.

rocknbil

8:18 pm on Mar 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard tonyledenko!

I have to agree, this is most likely a CSS issue and you may be able to get help in the CSS forum. Are you using SWFobject? It has many methods to get around cranky browsers.