1

http://shuffler.fm/trending mouse over the star to add it as a favorite

I'm trying to figure it out, the most i gather is css3 animation. i looked at their minified css though and I can't figure it out

Maybe a jsfiddle with the most basic form of this animation would be sweet

fmtooltip
{-webkit-perspective:1000;
    -webkit-backface-visibility:hidden;
position:relative}
a.fmtooltip span,div.fmtooltip span
{-webkit-transform:translate3d(0, 0, 0);
    -webkit-perspective:1000;
    -webkit-backface-visibility:hidden;
    width:auto;
    min-width:110px;
    height:auto;
    line-height:22px;
    padding:.3em .5em;
    left:50%;
    margin-left:-59px;
    font-size:11px;
    font-weight:700;
    color:#393939;
    text-shadow:none;
    text-align:center;
    background:#ffe6b0;
    -webkit-border-radius:1px;
    border-radius:1px;
    position:absolute;
    pointer-events:none;
    bottom:34px;
    opacity:0;
    z-index:9991 !important;
    -webkit-box-shadow:0px 1px 1px rgba(0,0,0,0.2);
    -moz-box-shadow:0px 1px 1px rgba(0,0,0,0.2);
    box-shadow:0px 1px 1px rgba(0,0,0,0.2);
    -webkit-transition:all 0.2s ease-in-out;
    -moz-transition:all 0.2s ease-in-out;
    -ms-transition:all 0.2s ease-in-out;
    -o-transition:all 0.2s ease-in-out;
transition:all 0.2s ease-in-out}
a.fmtooltip span.lefted,div.fmtooltip span.lefted
{margin-left:-110px;
    padding:.3em 1em;
    bottom:30px;
text-align:left}
a.fmtooltip span.lefted:before,a.fmtooltip span.lefted:after,div.fmtooltip span.lefted:before,div.fmtooltip span.lefted:after
{left:20%}
a.fmtooltip span.favo,div.fmtooltip span.favo
{text-transform:uppercase;
    line-height:23px;
    padding:.3em .9em;
    margin-left:-62px;
    font-family:'brandon-grotesque', Arial, sans-serif;
    bottom:22px;
text-indent:0}
a.fmtooltip span.playertooltip,div.fmtooltip span.playertooltip
{text-transform:uppercase;
    line-height:23px;
    padding:.3em .9em;
    margin-left:10px;
    left:411px;
    bottom:-16px;
text-indent:0}
a.fmtooltip span.playertooltip:nth-child(1),div.fmtooltip span.playertooltip:nth-child(1)
{left:449px;
width:140px}
a.fmtooltip span.playertooltip:before,a.fmtooltip span.playertooltip:after,div.fmtooltip span.playertooltip:before,div.fmtooltip span.playertooltip:after
{content:'';
    position:absolute;
    top:-5px;
    left:54%;
    margin-left:-12px;
    width:0;
    height:0;
    border-top:none;
    border-left:5px solid transparent;
    border-right:5px solid transparent;
border-bottom:5px solid #ffedb0}
a.fmtooltip span.playertooltip:after,div.fmtooltip span.playertooltip:after
{display:none}
a.fmtooltip span:before,a.fmtooltip span:after,div.fmtooltip span:before,div.fmtooltip span:after
{content:'';
    position:absolute;
    bottom:-6px;
    left:54%;
    margin-left:-12px;
    width:0;
    height:0;
    border-left:5px solid transparent;
    border-right:5px solid transparent;
border-top:5px solid rgba(130,130,130,0.3)}
a.fmtooltip span:after,div.fmtooltip span:after
{bottom:-4px;
border-top:5px solid #ffedb0}
a:hover.fmtooltip span,.tooltipshow
{opacity:.9 !important;
bottom:44px !important}
.tooltipshow.playertooltip
{opacity:.9 !important;
bottom:-24px !important}
div:hover.fmtooltip span
{opacity:.9 !important;
bottom:-24px !important}
a:hover.fmtooltip span.favo
{bottom:32px !important}
a:hover.fmtooltip span.lefted
{bottom:52px  !important}
figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span,figure.box.medium:nth-child(4n+4) a.fmtooltip span,figure.box.small:nth-child(5n+5) a.fmtooltip span
{margin-left:-119px}
figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span:before,figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span:after,figure.box.medium:nth-child(4n+4) a.fmtooltip span:before,figure.box.medium:nth-child(4n+4) a.fmtooltip span:after,figure.box.small:nth-child(5n+5) a.fmtooltip span:before,figure.box.small:nth-child(5n+5) a.fmtooltip span:after
{left:98%}
figure.box.large a.blogsubscription.fmtooltip span
{margin-left:-57px}
figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span
{margin-left:-110px}
figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span:before,figure.box.large:nth-child(4n+4) a.blogsubscription.fmtooltip span:after
{left:98%}
#favorite.fmtooltip span
{left:0;
    left:50%;
    margin-bottom:-0.5em;
    margin-left:-58px;
width:100px}
4

2 回答 2

3

Try this - http://jsfiddle.net/cTUgH/5/

HTML

<a href="#"> 
    i 
    <span> Add To Favorites </span>
</a>

CSS

a {
    display: block;
    margin: 100px;
    height: 30px;
    width: 30px;
    border: 2px solid #aaa;
    background: #eee;
    color: #888;
    line-height: 30px;
    border-radius: 20px;
    text-align: center;
    font: italic bold 16px/30px Georgia;
    text-decoration: none;
    position: relative;
    transition: all .5s ease-in-out;
}

span {
    display: block;
    height: 35px;
    width: 200px;
    border: 2px solid #aaa;
    background: #ffa;
    color: #888;
    position: absolute;
    top: -35px;
    left: -85px;
    border-radius: 20px;
    -webkit-transition: all .5s ease-in-out;
       -moz-transition: all .5s ease-in-out;
         -o-transition: all .5s ease-in-out;
            transition: all .5s ease-in-out;
    opacity: 0;
}

a:hover span {
    opacity: 1;
    top: -50px;
}
于 2012-06-28T00:58:51.090 回答
1

Why use animation in tooltip make it simple just use simple css have a look here

.tooltip
{
 display: inline;
 position: relative;
}
.tooltip:hover:after
{
 background: #333;
 background: rgba(0,0,0,.8);
 border-radius: 5px;
 bottom: 26px;
 color: #fff;
 content: attr(title);
 left: 20%;
 padding: 5px 15px;
 position: absolute;
 z-index: 98;
 width: 220px;
 max-width: 220px;
}

code credit to Talkerscode and full tutorial with demo here css3 tooltip

于 2016-06-08T06:47:07.447 回答