Nifty Modal - how to trigger a modal without a button

后端 未结 7 1887
有刺的猬
有刺的猬 2021-01-03 14:55

This script provides awesome modal transitions and I want to use them instead of a standard alert message.

Now the demo of the script shows how to trigger them by pr

7条回答
  •  耶瑟儿~
    2021-01-03 15:28

    you can add the class "md-show" to the div element that you are using as the modal dialog

    div example:

    if you are using jQuery

    query the div element by id to dynamically add the class

    $("#div_modal").addClass("md-show");
    

    To close the modal just remove that class

    $("#div_modal").removeClass("md-show");
    

    I hope that helps

提交回复
热议问题