我正在尝试在图像上获得脉冲效果。在这个 Fiddle中,我希望在红色圆圈周围有一个淡紫色的边框。红色圆圈应保持静止。我可以让它们都淡入和淡出,但不仅仅是紫色边框。请问有什么想法吗?
HTML
<div id="pulseDiv">
<div class="imgNoPulse"><img src="http://ubuntuone.com/1djVfYlV62ORxB8gSSA4R4">
<div class="imgPulse"><img src="http://ubuntuone.com/2DuAHohinZ7LETkwlSIpM5"></div>
</div>
CSS
.imgNoPulse { position:absolute;left:15px;top:15px;z-index:1; }
.imgPulse { position:absolute;left:-15px;top:-15px;z-index:-1; }
Javascript
function fadeThemIn(){
$('#pulseDiv').children('div').delay(400).fadeIn('slow',function(){fadeThemOut();});
};
function fadeThemOut(){
$('#pulseDiv').children('div').delay(400).fadeOut('slow',function(){fadeThemIn();});
};
$(document).ready(function(){
fadeThemIn();
});