IE Special comments

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
drumbo
Advanced
Advanced
Posts: 20
Joined: Tue Dec 06, 2005 7:09 pm

IE Special comments

Post by drumbo »

Hi,

I am using an ASP script to generate my menu_data file and I am using a special comment from MS (that IE detects and acts on) in the script, however by using this comment - the menu breaks (i.e I get javascript errors)

The code:

Code: Select all

with(HeadersStyle=new mm_style()){
<!--[if !IE]>
bordercolor="#66CCFF";
borderstyle="solid";
borderwidth=1;
<![endif]-->
headerbgcolor="#E3E9F4";

if I run the menu_data.asp script I can see the following

Code: Select all

(HeadersStyle=new mm_style())
{ 
headerbgcolor="#E3E9F4"; 
as you can see (because the browser is IE) the border information is stripped out which is what I want. However the menu fails.

Is there anyway around this?

Thanks
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

There is a much easier way to do this by using the menu's IE detection, here's how:

Code: Select all

with(HeadersStyle=new mm_style()){ 
if(ie){
bordercolor="#66CCFF"; 
borderstyle="solid"; 
borderwidth=1; 
}
headerbgcolor="#E3E9F4"; 

Hope this helps,
Andy
drumbo
Advanced
Advanced
Posts: 20
Joined: Tue Dec 06, 2005 7:09 pm

Post by drumbo »

Thanks Andy - works a treat
Post Reply