- 1
- 2
- 3
- 4
- 5
- 6
function shake(dom, power, count, duration) {
dom.stop();
for (var i = 0; i < count; i++) {
dom.animate({'margin-left': ((i%2 == 0) ? '+' : '-') + '=' + ((i == 0 || i == count-1) ? power/2 : power)}, duration);
}
}