2

The Pixastic "blend" filter seems to work fine on their demo site in IE9, but the actual downloadable code does not. I believe it's due to the "isIE" detection code in the pixastic.core.js file at line 426:

isIE : function() {
  return !!document.all && !!window.attachEvent && !window.opera;
}

Whenever Pixastic.Client.isIE() is called, it picks up IE9 with that test. If I comment out the block at line 204 which starts

if (imageIsCanvas && Pixastic.Client.isIE()) {

the Blend effect works fine in IE9.

Is there a snippet I could replace the "ieIE" function shown above with to keep old versions of IE away from the effects while allowing IE9? Or, if I have the detection wrong, where is it and how can I modify it to suit? Many thanks.

greenbank
  • 21
  • 2

1 Answers1

4

I found help in solution of detecting ie9 in this answer: Internet Explorer 9 Object Detection

Changing "isIE" function with the following snipped of code worked for me. It is not very clear solution, but solves the problem:

isIE : function() {
    var ie = (function(){
        var undef,
        v = 3,
        div = document.createElement('div'),
        all = div.getElementsByTagName('i');

        while (
                div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
                all[0]
        );

        return v > 4 ? v : undef;

    }());

    if (ie >= 9) {
        return false;
    } else {
        return !!document.all && !!window.attachEvent && !window.opera;
    }
}
Community
  • 1
  • 1
srnjak
  • 915
  • 7
  • 21