DESIGNED DEVELOPED DELIVERED

Mob: 07760 392284edward@ee-web.co.uk

ee-web thinks... a bit

Go on, make my day ... leave a comment

jQuery – IE7

November 15th, 2010 by Edward

I was creating a application that animated an image as you rolled over it. It was working fine in Safari (PC/Mac), FF, Opera, IE8, Chrome. But IE7 wasn’t working. Here’s part of the erronous code – much simplified –

$(currentLink).next().css ({
‘position’:’absolute’,
‘background-position’:’0 0′,
‘top’:’110px’,
‘left’:gtr,
‘display’:’none’,
});

The error is simple – when creating a list of “Attribute pairs” like this, IE7 will throw a wobble if the last one, has a comma at the end – and in fact, if you think about it, semmantically its probably correct. All the other browsers that I tested kind of ignor this (which is very kind I guess!)

So, for the last line replace with

….
‘left’:gtr,
‘display’:’none’
});

And Bob’s your uncle.

categories

Edward owns and runs ee-web design and has been building websites for over 12 years. He is passionate about... most things really

Was this post helpful or interesting? Spread the news.

Leave a comment

*


tag