gpt4 book ai didi

jquery - Navicon Transformicons 蓝色边框

转载 作者:行者123 更新时间:2023-11-28 12:58:40 24 4
gpt4 key购买 nike

我在玩 sara soueidan导航图标,分析后还有一些我不太明白的地方。

那些我似乎无法删除的图标周围有一个蓝色选择器,这是他的方法特有的还是对 jquery 的简单误解?

这是代码 http://jsfiddle.net/Ah6XA/

    <button type="button" role="button" aria-label="Toggle Navigation" id="mbtn" class="lines-button x">
<span class="lines"></span>
</button>
#mbtn {
display: inline-block;
margin: 0 1em;
border: none;
background: none;
}
#mbtn span {
display: block;
}

.lines-button {
padding: 2rem 1rem;
transition: .3s;
cursor: pointer;
/* */
}

.lines {
display: inline-block;
width: 4rem;
height: 0.57143rem;
background: #211f20;
border-radius: 0.28571rem;
transition: 0.3s;
position: relative;
}
.lines:before, .lines:after {
display: inline-block;
width: 4rem;
height: 0.57143rem;
background: #211f20;
border-radius: 0.28571rem;
transition: 0.3s;
position: absolute;
left: 0;
content: '';
-webkit-transform-origin: 0.28571rem center;
transform-origin: 0.28571rem center;
}
.lines:before {
top: 1rem;
}
.lines:after {
top: -1rem;
}

.lines-button:hover .lines:before {
top: 1.14286rem;
}
.lines-button:hover .lines:after {
top: -1.14286rem;
}

.lines-button.close {
-webkit-transform: scale3d(0.8, 0.8, 0.8);
transform: scale3d(0.8, 0.8, 0.8);
}

.lines-button.x.close .lines {
background: transparent;
}
.lines-button.x.close .lines:before, .lines-button.x.close .lines:after {
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
top: 0;
width: 4rem;
}
.lines-button.x.close .lines:before {
-webkit-transform: rotate3d(0, 0, 1, 45deg);
transform: rotate3d(0, 0, 1, 45deg);
}
.lines-button.x.close .lines:after {
-webkit-transform: rotate3d(0, 0, 1, -45deg);
transform: rotate3d(0, 0, 1, -45deg);
}



var anchor = document.querySelectorAll('button');

[].forEach.call(anchor, function(anchor){
var open = false;
anchor.onclick = function(event){
event.preventDefault();
if(!open){
this.classList.add('close');
open = true;
}
else{
this.classList.remove('close');
open = false;
}
}
});

最佳答案

如果你想在手机上去除边框,你必须添加这个:

-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

关于jquery - Navicon Transformicons 蓝色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21859036/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com