弹出层默认关闭按钮,使用<a>标签并且有href属性。造成了鼠标悬浮后会在浏览器左下角出现一个含有href值的白框

既然href没有用就去掉。再将其光标样式更改为小手。

css更改样式

.cursorStyle{
    cursor: pointer; 
}

js代码

		layer.open({
			type: 1,
			title: false,
			closeBtn: true,
			shadeClose: false,
			shade: 0.35,
			skin: 'contanct-class',
			anim: Math.ceil(Math.random() * 6),
			area: ['520px', '430px;'],
			content: $('#contactUs'),
			success: function(layero, index){
				layero[0].childNodes[1].childNodes[0].removeAttribute('href');
				layero[0].childNodes[1].classList.add('cursorStyle');
			}
		})

更改前

更改后

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐