Home  >  Article  >  Web Front-end  >  How to Open a Bootstrap Modal Window with jQuery?

How to Open a Bootstrap Modal Window with jQuery?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-17 08:28:03356browse

How to Open a Bootstrap Modal Window with jQuery?

How to Open a Bootstrap Modal Window Using jQuery

Solution

Twitter Bootstrap provides several functions that can be manually invoked on modal windows:

  • $('#myModal').modal('toggle'): Toggles the modal window between visible and hidden.
  • $('#myModal').modal('show'): Displays the modal window.
  • $('#myModal').modal('hide'): Hides the modal window.

To open a modal window programmatically, use the $('#myModal').modal('show') method instead of $('#my-modal').modal({ show: 'false' }).

Custom Popups

If you want to create a custom popup, consider using the following video tutorial:

[https://www.youtube.com/watch?v=zK4nXa84Km4](https://www.youtube.com/watch?v=zK4nXa84Km4)

The above is the detailed content of How to Open a Bootstrap Modal Window with jQuery?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn