想通了 - 最后很简单 - 两个背景图像在 css 中重叠,然后用不透明度取出一个
<div class="lamp1"></div>
<div class="lamp1 lampglow1"></div>
<div class="lamp2"></div>
<div class="lamp2 lampglow2"></div>
<div class="lamp3"></div>
<div class="lamp3 lampglow3"></div>
.lamp1{position:fixed; top:-100px; left:8%; background:url(/assets/img/lamp.png) no-repeat; width:200px; height:600px;}
.lamp2{position:fixed; top:-220px; left:5%; background:url(/assets/img/lamp.png) no-repeat; width:200px; height:600px;}
.lamp3{position:fixed; top:-110px; right:5%; background:url(/assets/img/lamp.png) no-repeat; width:200px; height:600px;}
.lampglow1{background:url(/assets/img/lampglow.png) no-repeat; width:200px; height:600px;}
.lampglow2{background:url(/assets/img/lampglow.png) no-repeat; width:200px; height:600px;}
.lampglow3{background:url(/assets/img/lampglow.png) no-repeat; width:200px; height:600px;}
$(document).ready(function() {
function pulsate() {
$(".lampglow1").animate({opacity: 0.2}, 3000, 'linear')
.animate({opacity: 1}, 3000, 'linear', pulsate);
$(".lampglow2").animate({opacity: 0.2}, 5000, 'linear')
.animate({opacity: 1}, 5000, 'linear', pulsate);
$(".lampglow3").animate({opacity: 0.2}, 4000, 'linear')
.animate({opacity: 1}, 4000, 'linear', pulsate);
}
pulsate();
});