1、渐变的文字,使用如下CSS属性,会有兼容性问题(iphone不行),建议不使用
background: linear-gradient(4deg, rgba(227, 39, 56, 1) 0%, rgba(161, 13, 18, 1) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
2、时间函数getTime()、getHours()等 在苹果手机上返回NaN
const newStartDate = new Date('2019-08-30').getTime();
const newStartHours = new Date('2019-08-30 12:09:00').getHours();
获取到的时间,在Android手机正常,在IPhone中返回NaN。
解决方案:
苹果手机必须这样写,必须用'/'的格式。(安卓手机也可以使用'/'格式。)----- '2019/08/30'
const newStartDate = new Date(value.replace(/-/g, '/')).getTime();
const newStartHours = new Date(value.replace(/-/g, '/')).getHours();
3、解决安卓手机input唤起软键盘顶起底部fix定位问题
通过window.onresize监听页面高度变化,在键盘弹出时把position设为static
let winHeight = window.innerHeight
window.onresize = () => {
let changeHeight = window.innerHeight
if (changeHeight < winHeight) {
// 键盘弹出
bottomBlock.style.position = 'static'
} else {
// 键盘收起
bottomBlock.style.position = 'fixed'
}
}