Animate.css doesnt work for Second click

后端 未结 3 1092
情深已故
情深已故 2021-01-25 03:48

If i click .img-1 or .img-2 first time it works. bt not in second time without page refresh. I am using Animate.css (zoomIn). Here is the code sample --

html:

         


        
3条回答
  •  忘掉有多难
    2021-01-25 04:22

    See it in jsfiddle http://jsfiddle.net/oxu69Luw/

    Script would be like below:

    $(function () {
        function applyZoomInOutAnim(x) {
            $('.back-end,.front-end,.dismiss').removeClass("zoomIn zoomOut").addClass(x + ' animated');
        }
    
        $('.img-1,.img-2').click(function () {
            applyZoomInOutAnim('zoomIn');
        });
    
        $('.dismiss').click(function () {
            applyZoomInOutAnim('zoomOut');
        });
    
    });
    

提交回复
热议问题