使用DOM插入CSS动画

时间:2014-09-14 00:39:56

标签: jquery css3 dom jquery-plugins css-animations

我想使用jQueries动态更改CSS3动画.css()我使用Animate.css库提供基本动画和Waypoints.js来激活动画。但是,该功能不会执行,也不会触发错误。我究竟做错了什么?

jQuery("#animateme").waypoint(function(direction){
                        if(direction === "down"){

                            jQuery('#animateme').removeClass("animated flash");
                            jQuery('#animateme').addClass("animated pulse").css({animation: function(){


                                        var jwduration = "2";
                                        var jwtime = "linear";
                                        var jwdelay = "2";
                                        var jwiteration = "2";

                                return (jwduration + "s " + jwtime " " + jwdelay + "s " + jwiteration + " "  );
                            }});

                        }
                     if(direction === "up"){

                            jQuery('#animateme').removeClass("animated pulse");
                            jQuery('#animateme').addClass("animated flash");
                        }

});

0 个答案:

没有答案