我已经为我的广告制作了一些工具提示,这些提示使用了很多专业术语 - 它们以简单的鼠标显示。显然,他们不能在触摸界面上工作。我的工具提示可以适用于触摸屏吗?
我仅限于理想纯HTML5和CSS3,绝对不是jQuery,理想情况下不是JavaScript。我试过改变(或者说加入):active:hover类,但在触摸屏上根本没有任何反应。
当前HTML和CSS是
.tiptext {
cursor: help;
color: black;
font-family: 'ProximaNova', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-weight: 600 !important;
border-bottom: 1px solid #ebebeb;
box-shadow: inset 0 -5px 0 #ebebeb;
-webkit-transition: background .15s cubic-bezier(.33, .66, .66, 1);
transition: background .15s cubic-bezier(.33, .66, .66, 1);
text-decoration: none;
font-size: 14px;
line-height: 172%;
-webkit-animation-name: link-helpoff;
-webkit-animation-duration: 1s;
animation-name: link-helpoff;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
transition-delay: 0.4s;
}
.tiptext::after {
content: "";
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
color: transparent;
background-color: transparent;
transition: background-color 0.5s linear;
}
.tiptext:hover::after {
background-color: rgba(255, 255, 255, 0.6);
}
.description {
border: 1px solid #e3e3e3;
background: white;
width: auto;
max-width: 275px;
height: auto;
padding: 10px;
font-family: 'ProximaNova', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-weight: 300;
color: rgb(39, 44, 45);
font-size: 13px;
z-index: 500;
position: absolute;
margin-left: 50px;
margin-top: 20px;
cursor: default;
display: inline-block;
}
.tiptext > .description {
visibility: hidden;
opacity: 0;
transition: visibility 0s linear 0.4s, opacity 0.4s linear;
}
.tiptext:hover > .description {
visibility: visible;
opacity: 1;
transition-delay: 0s;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-ms-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
}
.tiptext:hover {
color: black;
-webkit-animation-name: link-help;
-webkit-animation-duration: 0.6s;
animation-name: link-help;
animation-duration: 0.6s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
transition-delay: 0s;
}
<span class="tiptext">
<span class="description" style="text-align:center;">You can read more about the topic in this pop up box</span>
Mouse over me to learn more.
</span>
有一些动画和弄虚作假的CSS事情(和我没有将链接帮助的动画,但你的想法)基本上,当你将鼠标放在它上面时,这个盒子会淡入淡出 - 还有一个全屏幕的白色背景,它会淡入一点点不透明的状态,以便将蒙上眼睛的盒子放到焦点上 - 如果触摸时不发生这种情况,屏幕设备。
我怀疑可能需要进行实质性更改才能在触摸屏设备上按下相同的弹出框。
我不会介意,但没有怎么办?(改变:激活,:焦点,变化幅度以DIV),甚至可以让工具提示出现在我的任何iOS设备,点击它什么都不做。 –