var pos = parseInt(element.style.right.replace(/px|vw/gi, ''));
// if right === 0; return NaN
Resolution:
var pos = parseInt(element.style.right.replace(/px|vw/gi, '') + 0);
利用弱类型转换 依然存在bug, '90' + 0 = '900'
var nowRight = element.style.right;
var pos;
if (!nowRight) {
pos = parseInt(element.style.right.replace(/px|vw/gi, ''));
} else {
pos = 0;
}