首页 > 其他分享 >使用SCSS高亮显示控件、聚焦位置

使用SCSS高亮显示控件、聚焦位置

时间:2022-12-22 13:05:11浏览次数:56  
标签:SCSS 控件 高亮 156 sg emphasize inputDom 253 emphasizeDom


 

/*强调SCSS----------------------------------------*/
[sg-emphasize],/deep/[sg-emphasize] {
animation: sg-emphasize .3s ease 3;
}

@keyframes sg-emphasize {
0% {
transform: scale(1);
background: rgba(3, 156, 253, 0);
}
50% {
transform: scale(.9);
background: rgba(3, 156, 253, 0.2);
}
100% {
transform: scale(1);
background: rgba(3, 156, 253, 0);
}
}


/*强调js----------------------------------------*/
function emphasizeFocus(emphasizeSel, focusSel) {
var emphasizeDom = document.querySelector(emphasizeSel);
var inputDom = focusSel ? document.querySelector(focusSel) : emphasizeDom;
emphasizeDom.setAttribute("sg-emphasize", true), setTimeout(() => emphasizeDom.removeAttribute("sg-emphasize"), 900);
inputDom.scrollIntoView({behavior: "smooth", block: "nearest", inline: "nearest"}), inputDom.focus();
}

标签:SCSS,控件,高亮,156,sg,emphasize,inputDom,253,emphasizeDom
From: https://blog.51cto.com/u_15920212/5962654

相关文章