I have the following 2 pieces of code which do not work in IE8 and below.
services.each(function() {
$(this).hover(function() {
services.removeClass('active');
$(this).addClass('active');
});
});
Which fails as all 4 services have an active class at all times. Also in the following code the callback function doesn't add the completed class.
webform.click(function() {
if(!$(this).hasClass('expanded')) {
$(this).addClass('expanded');
$(this).animate({
marginLeft: '-25%',
width: "50%",
minWidth: '400px',
maxWidth: '700px',
padding: '0',
minHeight: "580px",
height: 'auto',
borderRadius: "0"
}, 1000, function () {
$(this).addClass('completed');
});
}
});
Can anyone tell me how to fix these, and more importantly what I should do in future to make sure my code is IE compatible.
FYI for anyone with similar jQuery/IE issues, I had a big problem with placing a comma after the last option e.g after borderRadius: "0"
above, which is ignored in all browsers except IE which throws a fit!!