call the same jQuery function in multiple buttons

后端 未结 10 2158
星月不相逢
星月不相逢 2020-12-01 11:12

I am not really familiar with jQuery. I have this code that I downloaded to create a fade in/fade out popup form. Here\'s the code:



        
10条回答
  •  长情又很酷
    2020-12-01 11:39

    you class can call them by class you using , seperated id

    $(document).ready(function() {
    $('#button, #button1, #button2').click(function(e) { 
    $('#modal').reveal({ 
    animation: 'fade',
    animationspeed: 150,
    closeonbackgroundclick: true, 
    dismissmodalclass: 'close'
    });
    return false;
    });
    });​
    

提交回复
热议问题