简体   繁体   中英

Custom window popup

Besides window.alert() , window.confirm() and window.prompt() , is it possible to create custom popup decision?

For example: When you write a comment on facebook and try to close the window, a popup appears and its buttons are Leave and Stay.

Yes, check out bootstrap modals

http://getbootstrap.com/javascript/#modals

There are other css frameworks and libraries that implement modals as well. Essentially these are just divs that have a higher z-index than the rest of the page with some buttons on them. Because of this they are completely customizable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM