IE兼容scrollTo、scrollTop,input输入框自带X,safari输入框自带

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;}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值