jquery - animationend is triggerd only once in firefox -



jquery - animationend is triggerd only once in firefox -

i want create simple slider css animation , play code: http://tympanus.net/development/imagetransitions/index6.html. seems works in desktop browsers tested except firefox. in firefox animationend event triggered 1 time reason. have ideas why animationend event triggerd 1 time firefox , works ok in other browsers?

css:

.te-example4.te-show .te-front{ animation: example4front 0.8s ease-in-out forwards; -ms-animation: example4front 0.8s ease-in-out forwards; -moz-animation: example4front 0.8s ease-in-out forwards; -o-animation: example4front 0.8s ease-in-out forwards; -webkit-animation: example4front 0.8s ease-in-out forwards; } @keyframes example4front{ 0% { transform: translatex(0); z-index: 3;} 50% { transform: rotatez(-5deg) translatex(-339px); z-index: 3;} 51% { z-index: 1;} 100% { transform: rotatez(0deg) translatex(0px); z-index: 1;} } @-moz-keyframes example4front{ 0% { -moz-transform: translatex(0); z-index: 3;} 50% { -moz-transform: rotatez(-5deg) translatex(-339px); z-index: 3;} 51% { z-index: 1;} 100% { -moz-transform: rotatez(0deg) translatex(0px); z-index: 1;} } @-ms-keyframes example4front{ 0% { -ms-transform: translatex(0); z-index: 3;} 50% { -ms-transform: rotatez(-5deg) translatex(-339px); z-index: 3;} 51% { z-index: 1;} 100% { -ms-transform: rotatez(0deg) translatex(0px); z-index: 1;} } @-o-keyframes example4front{ 0% { -o-transform: translatex(0); z-index: 3;} 50% { -o-transform: rotatez(-5deg) translatex(-339px); z-index: 3;} 51% { z-index: 1;} 100% { -o-transform: rotatez(0deg) translatex(0px); z-index: 1;} } @-webkit-keyframes example4front{ 0% { -webkit-transform: translatex(0); z-index: 3;} 50% { -webkit-transform: rotatez(-5deg) translatex(-339px); z-index: 3;} 51% { z-index: 1;} 100% { -webkit-transform: rotatez(0deg) translatex(0px); z-index: 1;} }

javascript:

$(function() { var transitioneffects = (function() { var $tewrapper = $('#te-wrapper'), $tecover = $tewrapper.find('div.te-cover'), $teimages = $tewrapper.find('div.te-images > img'), imagescount = $teimages.length, currentimg = 0, $navnext = $('#te-next'), $type = $('#type'), type = $type.val(), $tetransition = $tewrapper.find('.te-transition'), animated = false, // check back upwards hasperspective = modernizr.csstransforms3d, init = function() { $tetransition.addclass( type ); $navnext.on( 'click', function( event ) { if( hasperspective && animated ) { console.log('antimated: ' + animated); console.log('hasperspective: ' + hasperspective); homecoming false; } animated = true; shownext(); homecoming false; }); if( hasperspective ) { $tewrapper.on({ 'animationstart mozanimationstart oanimationstart webkitanimationstart' : function( event ) { console.log('animationstart'); }, 'animationend mozanimationend oanimationend webkitanimationend' : function( event ) { $tecover.removeclass('te-hide'); $tetransition.removeclass('te-show'); animated = false; console.log('animationend'); console.log(event.animationname); console.log(event.originalevent.animationname); } }); } }, shownext = function() { if( hasperspective ) { $tetransition.addclass('te-show'); $tecover.addclass('te-hide'); } updateimages(); }, updateimages = function() { var $back = $tetransition.find('div.te-back'), $front = $tetransition.find('div.te-front'); ( currentimg === imagescount - 1 ) ? ( last_img = imagescount - 1, currentimg = 0 ) : ( last_img = currentimg, ++currentimg ); var $last_img = $teimages.eq( last_img ), $currentimg = $teimages.eq( currentimg ); $front.empty().append('<img src="' + $last_img.attr('src') + '">'); $back.empty().append('<img src="' + $currentimg.attr('src') + '">'); $tecover.find('img').attr( 'src', $currentimg.attr('src') ); }; homecoming { init : init }; })(); transitioneffects.init(); });

when next button clicked image changed using animation effect.

why doesn't work in firefox? firefox bug or what?

jquery css animation

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -