Skip to content

Commit

Permalink
fix issue #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Renaud-RSC committed Mar 10, 2016
1 parent 69948b1 commit dc39db1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.marquee.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,14 @@
//Add css3 animation to the element
$marqueeWrapper.css(animationString, animationCss3Str);
var keyframeCss = keyframeString + ' { 100% ' + _objToString(animationCss) + '}',
$styles = $('style');
$styles = $marqueeWrapper.find('style');

//Now add the keyframe animation to the head
//Now add the keyframe animation to the marquee element
if ($styles.length !== 0) {
//Bug fixed for jQuery 1.3.x - Instead of using .last(), use following
$styles.filter(":last").append(keyframeCss);
$styles.filter(":last").html(keyframeCss);
} else {
$('head').append('<style>' + keyframeCss + '</style>');
$marqueeWrapper.append('<style>' + keyframeCss + '</style>');
}

//Animation iteration event
Expand Down

0 comments on commit dc39db1

Please sign in to comment.