Skip to content

Instantly share code, notes, and snippets.

@henricavalcante
Created October 15, 2012 12:51
Show Gist options
  • Save henricavalcante/3892299 to your computer and use it in GitHub Desktop.
Save henricavalcante/3892299 to your computer and use it in GitHub Desktop.
spritely correction
spStop: function(bool) {
$(this).each(function() {
var el_id = $(this).attr('id');
//modificação para evitar erros de stop
if($._spritely.instances[el_id] && $._spritely.instances[el_id]['options'])
{
if ($._spritely.instances[el_id]['options']['fps']) {
$._spritely.instances[el_id]['_last_fps'] = $._spritely.instances[el_id]['options']['fps'];
}
$._spritely.instances[el_id]['_stopped'] = true;
$._spritely.instances[el_id]['_stopped_f1'] = bool;
if ($._spritely.instances[el_id]['type'] == 'sprite') {
$(this).spSet('fps', 0);
}
if (bool) {
// set background image position to 0
var bp_top = $._spritely.getBgY($(this));
$(this).css('background-position', '0 ' + bp_top);
}
}
});
return this;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment