Fancybox doesn't work with jQuery v1.9.0 [ f.browser is undefined / Cannot read property 'msie' ]

前端 未结 4 1594
执笔经年
执笔经年 2020-11-22 03:07

Fancybox breaks with the new jQuery v1.9.0.

It affects both, Fancybox v1.3.4 and below - and - v2.1.3 and below.

The errors shown are :

4条回答
  •  萌比男神i
    2020-11-22 03:40

    In case anyone still has to support legacy fancybox with jQuery 3.0+ here are some other changes you'll have to make:

    .unbind() deprecated

    Replace all instances of .unbind with .off

    .removeAttribute() is not a function

    Change lines 580-581 to use jQuery's .removeAttr() instead:

    Old code:

    580: content[0].style.removeAttribute('filter');
    581: wrap[0].style.removeAttribute('filter');
    

    New code:

    580: content.removeAttr('filter');
    581: wrap.removeAttr('filter');
    

    This combined with the other patch mentioned above solved my compatibility issues.

提交回复
热议问题