xcatliu / react-ie8

Make your React app work in IE8
http://react-ie8.xcatliu.com/
998 stars 162 forks source link

Velocity: IE8 and below require jQuery to be loaded before Velocity. #27

Closed wuhaih closed 7 years ago

wuhaih commented 8 years ago

Velocity: IE8 and below require jQuery to be loaded before Velocity. 这是什么情况,我引入了ANTDESIGN的menu控件,在IE8不支持

xcatliu commented 8 years ago

根据这个英文,可能是需要预先加载 jQuery 吧

gniria commented 8 years ago

Velocity.js:

        var $,
            isJQuery = false;

        if (global.fn && global.fn.jquery) {
            $ = global;
            isJQuery = true;
        } else {
            $ = window.Velocity.Utilities;
        }

        if (IE <= 8 && !isJQuery) {
            throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");
        } else if (IE <= 7) {
            /* Revert to jQuery's $.animate(), and lose Velocity's extra features. */
            jQuery.fn.velocity = jQuery.fn.animate;

            /* Now that $.fn.velocity is aliased, abort this Velocity declaration. */
            return;
        }

在你的html里引入jquery,比如:

<!--[if lte IE 8]>
<script type="text/javascript" src="/assets/js/jquery-1.11.1.js"></script>
<![endif]-->