Display Bootstrap Modal using javascript onClick

后端 未结 4 1509
时光取名叫无心
时光取名叫无心 2021-02-03 20:48

I need to be able to open a Twitter bootstrap modal window using the onClick=\"\" or similar function. Just need the code to go into the onClick=\"\".

4条回答
  •  悲&欢浪女
    2021-02-03 21:41

    I had the same problem, after researching a lot, I finally built a js function to create modals dynamically based on my requirements. Using this function, you can create popups in one line such as:

    puyModal({title:'Test Title',heading:'Heading',message:'This is sample message.'})
    

    Or you can use other complex functionality such as iframes, video popups, etc.

    Find it on https://github.com/aybhalala/puymodals For demo, go to http://pateladitya.com/puymodals/

提交回复
热议问题