如果有以下代码,但在淡入和淡出之后我无法暂停:
$(document).ready(function () {
$('#signupButtonFlash').each(function (i) {
// Get the image, set the count and an interval.
var img = $('.bttn_play');
img[0].$count = 0;
img[0].$interval = setInterval(function () {
// Animate the opacity over .2 seconds
img.animate({
opacity: .3
}, 400, function ()
{
// When finished, animate it back to solid.
img.animate({
opacity: 1
}, 400);
});
// Clear the interval once we've reached 1000.
if (++img[0].$count >= 1000) {
clearInterval(img[0].$interval);
}
}, 1000);
});
});