Skip to content

Commit

Permalink
Modifying the example so that we're adding the class to the "currentT…
Browse files Browse the repository at this point in the history
…arget" of the event ($luigi) - this will make a more interesting example later
  • Loading branch information
weaverryan committed May 23, 2012
1 parent abeab18 commit ab52fae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions css/style.css
Expand Up @@ -41,6 +41,9 @@ body {
display: none;
position: relative;
}
.event-details .luigi.active .kick-butt {
display: block;
}
.event-details .luigi .kick-butt .fireball {
position: absolute;
left: 70px;
Expand Down
13 changes: 6 additions & 7 deletions index.html
Expand Up @@ -85,7 +85,7 @@
var $luigi = $('.event-details .luigi');

$luigi.click(function() {
var $wrapper = $(this).find('.kick-butt').show();
$luigi.addClass('active');

var $fireball = $(this).find('.fireball');
var $enemy = $(this).find('.enemy');
Expand All @@ -99,12 +99,11 @@
$bam.show();

setTimeout(function() {
$wrapper.fadeOut(null, function() {
$fireball.css({left: '70px'});
$fireball.show();
$enemy.show();
$bam.hide();
});
$luigi.removeClass('active');
$fireball.css({left: '70px'});
$fireball.show();
$enemy.show();
$bam.hide();
}, 1000);
});

Expand Down

0 comments on commit ab52fae

Please sign in to comment.