This code results in an error at second line ($(‘boxes div.box’))
<script type="text/javascript">
$(document).ready(function () {
boxes = $('#boxes div.box');
images = $('#images > div');
boxes.each(function (idx) {
$(this).data('image', images.eq(idx));
}).hover(
function () {
boxes.removeClass('active');
images.removeClass('active');
$(this).addClass('active');
$(this).data('image').addClass('active');
});
});
</script>
The error is “Object doesn’t support this property or method”. The same page works fine in Firefox and Chrome.
Anyone?
You need to declare variables with the
varkeyword, otherwise IE has no idea where they’re coming from and so will just break: