IE
兼容 scrollTo scrollTop
dom.scrollTo IE不识别
(window.scrollTo()是有的)
scrollTop
const distance = 50
if(typeof xxx.scrollTo != 'function'){
xxx.scrollTop = distance
}else{
xxx.scrollTo(0,distance)
}
兼容append 、 appendChild
ie 使用append报错,换appendChild
const html = document.createElement('div')
html.className = 'yi-toast'
html.innerHTML = `<div class='text'>巴拉巴拉提示内容</div>`
document.body.appendChild(html);
兼容IE input 输入框自带X ,safari输入框自带右侧按钮
input::-webkit-credentials-auto-fill-button , // password
input::-webkit-contacts-auto-fill-button { // other
display: none !important;
visibility: hidden;
pointer-events: none;
position: absolute; /* 避免占用 input 元素额外的 padding,正常情况下存在 display: none!; 就可以了 */
right: 0;
}
input[type=text]::-ms-clear{display: none;}
input[type=search]::-ms-clear{display: none;}
input::-webkit-search-cancel-button{display: none;}