我分析了他的那个网页,这个不是用图片做出来的,而是用CSS中的动画来实现的
下面是html脚本
<div class="tooltip img32" style="top: 61px; left: 656px; z-index: 1;" data-animationtype="ltr-slide" data-round="roundBgW" data-button="moreblack" data-tooltipbg="bgblack"><div class="roundBgW"></div><div class="roundBgWIn"></div><div class="roundBgWInner"></div><div class="button moreblack"></div><div class="descrContainer"><div class="pass-ltr"></div><div class="descr bgblack ltr-before"><div class="xs" style="display: none;">
<p>Left-to-right tooltip containing an image</p>
<img alt="an image" src="./images/Empire-State-Building-small.jpeg">
</div></div></div></div>
下面是css定义
.roundBgW{
border-radius: 30px;
position: absolute;
animation: pulseW 1.5s 1s infinite alternate;
-moz-animation: pulseW 1.5s 1s infinite alternate; /* Firefox */
-webkit-animation: pulseW 1.5s 1s infinite alternate; /* Safari and Chrome */
-o-animation: pulseW 1.5s 1s infinite alternate; /* Opera */
}
.roundBgWIn{
border-radius: 30px;
position: absolute;
top: 4px;
left: 4px;
animation: pulseWIn 1.5s 0.5s infinite alternate;
-moz-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Firefox */
-webkit-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Safari and Chrome */
-o-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Opera */
}
.roundBgWInner{
border-radius: 30px;
position: absolute;
top: 7px;
left: 7px;
animation: pulseWInner 1.5s infinite alternate;
-moz-animation: pulseWInner 1.5s infinite alternate; /* Firefox */
-webkit-animation: pulseWInner 1.5s infinite alternate; /* Safari and Chrome */
-o-animation: pulseWInner 1.5s infinite alternate; /* Opera */
}
@keyframes pulseW
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-moz-keyframes pulseW /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-webkit-keyframes pulseW /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-o-keyframes pulseW /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@keyframes pulseWIn
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-moz-keyframes pulseWIn /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-webkit-keyframes pulseWIn /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-o-keyframes pulseWIn /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@keyframes pulseWInner
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-moz-keyframes pulseWInner /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-webkit-keyframes pulseWInner /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-o-keyframes pulseWInner /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
你可以参考一下
我把這段代碼運行啦一下,看不到任何效果,如果兄弟方便的話,你把你的文件打包發我一下好嗎?
@wanghongxing: http://ipicture-square.justmybit.com/css/jQuery.iPicture.css 你可以在这个基础上做些研究
@陈希章: 這個插件為什么在IE下下運行看不到效果呀
@wanghongxing: 建议你善用方法,例如这个css中提到了animation,那么可以进一步自己研究,搜索得到 http://www.w3schools.com/css3/css3_animations.asp
@陈希章:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
/* white round bg */
.img32 .roundBgW{
height: 50px;
width: 50px;
left: -9px;
position: absolute;
top: -9px;
}
.img32 .roundBgWIn{
height: 42px;
width: 42px;
position: absolute;
left: -5px;
top: -5px;
}
.img32 .roundBgWInner{
height: 36px;
width: 36px;
position:absolute;
left: -2px;
top: -2px;
}
.roundBgW{
border-radius: 30px;
position: absolute;
animation: pulseW 1.5s 1s infinite alternate;
-moz-animation: pulseW 1.5s 1s infinite alternate; /* Firefox */
-webkit-animation: pulseW 1.5s 1s infinite alternate; /* Safari and Chrome */
-o-animation: pulseW 1.5s 1s infinite alternate; /* Opera */
}
.roundBgWIn{
border-radius: 30px;
position: absolute;
top: 4px;
left: 4px;
animation: pulseWIn 1.5s 0.5s infinite alternate;
-moz-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Firefox */
-webkit-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Safari and Chrome */
-o-animation: pulseWIn 1.5s 0.5s infinite alternate; /* Opera */
}
.roundBgWInner{
border-radius: 30px;
position: absolute;
top: 7px;
left: 7px;
animation: pulseWInner 1.5s infinite alternate;
-moz-animation: pulseWInner 1.5s infinite alternate; /* Firefox */
-webkit-animation: pulseWInner 1.5s infinite alternate; /* Safari and Chrome */
-o-animation: pulseWInner 1.5s infinite alternate; /* Opera */
}
@keyframes pulseW
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-moz-keyframes pulseW /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-webkit-keyframes pulseW /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@-o-keyframes pulseW /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.2);}
}
@keyframes pulseWIn
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-moz-keyframes pulseWIn /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-webkit-keyframes pulseWIn /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@-o-keyframes pulseWIn /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.3);}
}
@keyframes pulseWInner
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-moz-keyframes pulseWInner /* Firefox */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-webkit-keyframes pulseWInner /* Safari and Chrome */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
@-o-keyframes pulseWInner /* Opera */
{
from {background: rgba(255,255,255, 0);}
to {background: rgba(255,255,255, 0.6);}
}
</style>
</head>
<body>
<div style="border: 1px solid red; height: 500px; background-color: Black; position: relative">
<div class="tooltip img32" style="top: 20px; left: 403px; position: absolute">
<div class="roundBgW">
</div>
<div class="roundBgWIn">
</div>
<div class="roundBgWInner">
</div>
</div>
</div>
</body>
</html>
這段代碼運行可以看到我要的閃動效果,但是這個效果不支持IE ,在Google 火狐都可以看到,我就想如果做成一張圖片,就可以啦,但這需要會photoshop ,但我不會,請問你可以做嗎?
@wanghongxing: IE的早期版本可能对css 3.0支持不好,但IE 10是可以的,我这里就可以。
我也不怎么会Photoshop,不好意思啦
@陈希章: 哦,我知道IE10可以支持CSS3,但我現在是給一個公司做網站,瀏覽這個網站的并不一定都是是用IE10的版本呀,還有很多ie6,ie7,ie8的版本,到時那些人不是看不到
@wanghongxing: 是的,这个比较麻烦。如果能找到设计gif的高手就更好了,图片应该是通用的
闪烁是由js生成的