Here's the full reproduction。動畫使用僞元素。 CSS的:
.help-bubble .help-bubble-outer-dot {
margin: 1px;
display: block;
text-align: center;
opacity: 1;
background-color: rgba(0,149,255,0.4);
width: 12px;
height: 12px;
border-radius: 50%;
animation: help-bubble-pulse 1.5s linear infinite;
}
.help-bubble {
display: block;
position: absolute;
z-index: 2;
cursor: pointer;
left: 40px;
top: 40px;
}
.help-bubble::after {
content: "";
background-color: #3af;
width: 12px;
height: 12px;
border-radius: 50%;
position: absolute;
display: block;
top: 1px;
left: 1px;
}
.help-bubble .help-bubble-inner-dot {
background-position: absolute;
display: block;
text-align: center;
opacity: 1;
background-color: rgba(0,149,255,0.4);
width: 12px;
height: 12px;
border-radius: 50%;
-webkit-animation: help-bubble-pulse 1.5s linear infinite;
-moz-animation: help-bubble-pulse 1.5s linear infinite;
-o-animation: help-bubble-pulse 1.5s linear infinite;
animation: help-bubble-pulse 1.5s linear infinite;
}
.help-bubble .help-bubble-inner-dot:after {
content: "";
background-position: absolute;
display: block;
text-align: center;
opacity: 1;
background-color: rgba(0,149,255,0.4);
width: 12px;
height: 12px;
border-radius: 50%;
-webkit-animation: help-bubble-pulse 1.5s linear infinite;
-moz-animation: help-bubble-pulse 1.5s linear infinite;
-o-animation: help-bubble-pulse 1.5s linear infinite;
animation: help-bubble-pulse 1.5s linear infinite;
}
@keyframes help-bubble-pulse{
0% {
transform: scale(1);
opacity: .75;
}
25% {
transform:scale(1);
opacity:.75;
}
100% {
transform:scale(2.5);
opacity:0
}
}
爲了記錄在案,我不是很精通代碼的知識產權,但它不太可能你有權利不以某種方式讓你自己正是用這個。
你可以看看這個:https://codepen.io/nickpettit/pen/vacDI – Meinkraft
這是完美的,正是我在找什麼,thx – raffian
在這裏的另一個例子http://jsfiddle.net/dH6LS/ 1667 /如果您需要更多幫助,我可以幫助您。 –