Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery/js-使用单击函数animate.css来设置动画并显示另一个元素_Javascript_Jquery - Fatal编程技术网

Javascript jquery/js-使用单击函数animate.css来设置动画并显示另一个元素

Javascript jquery/js-使用单击函数animate.css来设置动画并显示另一个元素,javascript,jquery,Javascript,Jquery,我在这个网站上引用animate.css 1-我有点击功能: function animationClick(element, animation){ element = $(element); element.click( function() { element.addClass('animated ' + animation); //wait for animation to finish be

我在这个网站上引用animate.css
1-我有点击功能:

function animationClick(element, animation){
    element = $(element);
    element.click(
        function() {
            element.addClass('animated ' + animation);        
            //wait for animation to finish before removing classes
            window.setTimeout( function(){
                element.removeClass('animated ' + animation);
            }, 2000);         

        });
}
2-我在这里调用函数,但我想做一些更改,如果我单击(#容器),它将在下面设置动画并显示(.content):

我已经解决了我的问题:)

animationClick($('.content'),'bounce')谢谢,默认的(.content)是隐藏的,但是如何显示(.content)
$(document).ready(function(){
    $('#container').each(function() {
        animationClick(this, 'bounce'); // how I modified this line
        $('.content').show(); // I want to show and animate bounce for (.content) not (#container)
    });
});
 $(function() {  
        $("#container").click(function() { 
           $(".content").show(); 
            animate(".content p", 'animated bounceInDown');  
            return false;  
        });  
    });  

    function animate(element_ID, animation) {  
        $(element_ID).addClass(animation);  
        var wait = window.setTimeout( function(){  
            $(element_ID).removeClass(animation)}, 1300  
        );  
    }