Authored by htoooth

fix ie8 wrong

42.5 KB | W: | H:

608 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -5,8 +5,10 @@
*/
var $ = require('yoho-jquery');
var areaSelect = {
isIE8: window.navigator.appName === 'Microsoft Internet Explorer' && window.navigator.appVersion.match(/8./i) === '8.', // eslint-disable-line
require('../../common'); // eslint-disable-line
var areaSelect = { // eslint-disable-line
isIE8: window.isIE8,
init: function($el, areaCode) {
var city, province, area;
... ...
... ... @@ -215,6 +215,28 @@ function isLogin() {
}
}
function isIE() {
return /msie|trident/i.test(navigator.userAgent);
}
function isIEVer(version) {
var ver = '';
var getVersion = function(regex) {
var ua = navigator.userAgent;
var match = ua && ua.match(regex);
return (match && match.length > 1 && match[1]) || '';
};
if (isIE()) {
ver = getVersion(/(?:msie |rv:)(\d+(\.\d+)?)/i);
return ver === version;
}
return false;
}
// 品友
function addPyEvent(eventName, val) {
if (typeof window.py === 'function') {
... ... @@ -247,6 +269,10 @@ window.registerUrl = registerUrl;
window.jumpUrl = jumpUrl;
window.isIE = isIE;
window.isIE8 = isIEVer('8.0');
window.once = once;
window.addPyEvent = addPyEvent;
... ...