我想实现具有鼠标悬停效果的小圆圈(触摸点)(鼠标悬停时圆圈会变大并包含几行文本) - 请参阅 jsfiddle http://jsfiddle.net/eRDy6/1/
我试图改编一些在网上找到的代码,但努力做两件事:
我无法将“阅读”一词居中(垂直和水平)到圆圈的中间。我怎么能做到这一点。
我想在大圆圈中显示不同的文本。最好的方法是什么?
非常感谢您的帮助
<div class="middle clear">
<div id="touchPointContainer">
<div id="touchPoint1" class="touchPoint">
<p>read</p>
</div>
<div id="touchPoint2" class="touchPoint">
<p>read</p>
</div>
<div id="touchPoint3" class="touchPoint">
<p>read</p>
</div>
</div>
</div><!-- End DIV Middle clear -->
CSS:
.middle {
display: block;
clear: both;
margin-right: auto;
margin-left: auto;
width: 980px;
background: red;
box-shadow: 0px 0px 10px 2px #e0e0e0;
-webkit-box-shadow: 0px 0px 10px 2px #e0e0e0;
-moz-box-shadow: 0px 0px 10px 2px #e0e0e0;
}
#touchPointContainer {
height: 600px;
background: green;
position: relative;
}
.touchPoint {
height: 60px;
width: 60px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.1);
-o-box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.1);
position: absolute;
text-align: center;
color: #5bb6e7;
font-size: 12px;
-webkit-transition: width .2s, height .2s, margin .2s;
-moz-transition: width .2s, height .2s, margin .2s;
-o-transition: width .2s, height .2s, margin .2s;
-ms-transition: width .2s, height .2s, margin .2s;
transition: width .2s, height .2s, margin .2s;
}
.touchPoint:hover {
height: 160px;
width: 160px;
margin: -40px 0px 0px -40px;
-webkit-transition: width .2s, height .2s, margin .2s;
-moz-transition: width .2s, height .2s, margin .2s;
-o-transition: width .2s, height .2s, margin .2s;
-ms-transition: width .2s, height .2s, margin .2s;
transition: width .2s, height .2s, margin .2s;
}
#touchPoint1 {
top: 260px;
left: 140px;
}
#touchPoint2 {
top: 240px;
left: 360px;
}
#touchPoint3 {
top: 180px;
left: 720px;
}