你不想要真正的跳动心脏效果吗?
那你还在等什么?检查以下;)
HTML
<img id="seventyfive"
src="http://upload7.ir/imgs/2014-02/60314995125165880641.png"/>
CSS
#seventyfive{
position:absolute;
font-size:100px;
top: 50px;
left: 50px;
font-weight:bold;
}
JS
var size = 150;
var s_size = 0.66 * size;
var m_size = 0.83 * size;
var s_resize = ( size - s_size )/2;
var m_resize = ( size - m_size )/2;
var image = $('#seventyfive').css('width',size);
var x = image.offset().left;
var y = image.offset().top;
function pulse() {
image.animate({
width: s_size, top:x+s_resize,left:y+s_resize
}, 350, function() {
image.animate({
width: size, top:x, left:y
}, 100, function() {
image.animate({
width: m_size, top:x+m_resize, left:y+m_resize
}, 70 ,function(){
image.animate({
width: size, top:x , left:y
}, 70, function() {
pulse();
});
});
});
});
};
pulse();
小提琴演示在这里