Javascript jquery/js-使用单击函数animate.css来设置动画并显示另一个元素
我在这个网站上引用animate.cssJavascript 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
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
);
}