Simple browser detect then change visibility of a layer
Hi all,
I am using CSS text-shadow but of course IE doesn't like it. I've looked into some methods for achieving the same effect in IE, but it's not at all the same so I've opted for another method...
I'm going to have two layers. In layer1, it will be standard text, shadowed with CSS. I then screenshotted that and will use the resulting jpeg for layer2.
I was then planning to find a script that:
1. Detects if browser is IE
2. If IE, layer2 is visible, layer1 is invisible
3. If not IE, layer1 is visible, layer2 is invisible
The problem is that I can't find a simple script to detect if the browser's IE or not. I can find loads of scripts that check what version of IE someone's using. The version isn't important!
I'll have another look tomorrow (bed time now) but can you point me in the right direction?
However, all this technicality is probably pointless because the aim of the exercise is to
determine if the browser is an IE style. If IE9 is HTML5 compliant and does not support
document.all, then that's all you need; probably. Since IE9 does not support document.all
you have been able to determine if the browser is complaint to standards.
The above is the most common way to use the conditional HTML.
Your first example attempts to hide something which is already hidden; or actually does
not even have a display method. Regardless of your efforts the declarations are still
there.
The second example attempts to execute some conditional HTML inside a Style
declaration. This won't work because the conditional HTML is not executed inside the
style /style tags.
Try this (I mean try because I could not be bothered to drag out different browsers to
try myself.
Bookmarks