0

I have a site using Isotope.js to filter some news items. It works in all browsers/platforms perfectly except in IE8 and IE9 it does not seem to filter; nothing happens when I click the filtering links. I can't tell if the boxes are even smoothly moving around because I can't resize my browser in IE on my testing station. (I have a virtual IE 8 and 9 machine running on one PC workstation for my testing)

Here's my script:

$(function () {

    var $container = $('#news-item-listing');

    $('#news-item-listing').isotope({
        // options
        itemSelector: '.news_box',
        layoutMode: 'fitRows'
    });

    $('#news-item-listing').isotope({
        filter: '.news_box'
    }, function ($items) {
        var id = this.attr('id'),
            len = $items.length;
        console.log('Isotope has filtered for ' + len + ' items in #' + id);
    });

    // filter items when filter link is clicked
    $('#categories a').click(function () {
        var selector = $(this).attr('data-filter');
        $container.isotope({
            filter: selector
        });
        return false;
    });

    $('#categories a').click(function (e) {
        e.preventDefault();
        $('a').removeClass('active');
        $(this).addClass('active');
    });


});

Here's my jsfiddle

I suspect something is wrong with my script? Thank you in advance!

Dhaval Marthak
  • 17,246
  • 6
  • 46
  • 68
tyler_lisa
  • 385
  • 1
  • 5
  • 14
  • Seems like if I get rid of this part of the script, it fixes it in IE 9 at least: $('#news-item-listing').isotope({ filter: '.news_box' }, function ($items) { var id = this.attr('id'), len = $items.length; console.log('Isotope has filtered for ' + len + ' items in #' + id); }); – tyler_lisa Mar 19 '14 at 16:33
  • Do you get any errors on the console? If I was guessing I'd say 7 and 8 might not support `data` attributes but just googled it and turns out they do. I remember having issues using `console.log` on IE8 though so that could be a factor - http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8 so you could try removing the console logging lines and see if that makes a difference in IE. – martincarlin87 Mar 19 '14 at 16:37
  • Thank you @martincarlin87, yes, I removed the console log bit and now it is working in IE9...still not sorting in IE8. – tyler_lisa Mar 19 '14 at 16:42
  • not sure what else could be wrong with it, do you get any errors> If you can make a fiddle that would help others solve it too. – martincarlin87 Mar 19 '14 at 16:44
  • I do get an error; it has to do with a modernizr script I am using; I will try that; thanks. I do have a link in my original post to my js fiddle. – tyler_lisa Mar 19 '14 at 16:48

0 Answers0