Home >Web Front-end >JS Tutorial >How to Open a Bootstrap Modal Window Using jQuery?

How to Open a Bootstrap Modal Window Using jQuery?

Linda Hamilton
Linda HamiltonOriginal
2024-11-14 17:04:02779browse

How to Open a Bootstrap Modal Window Using jQuery?

Opening Bootstrap Modal Window using jQuery

In Bootstrap, you can manually manipulate modal windows using specific functions.

Function Call Examples:

$('#myModal').modal('toggle'); // Toggle visibility
$('#myModal').modal('show'); // Show modal
$('#myModal').modal('hide'); // Hide modal

Specific Problem Resolution:

In your provided code, the following modification needs to be made:

Replace:

$('#my-modal').modal({
    show: 'false'
}); 

With:

$('#myModal').modal('show'); 

Additional Information:

  • For more details, refer to Bootstrap's modal component documentation, specifically the methods section.
  • For a custom popup solution, you may consider the video tutorial at https://www.youtube.com/watch?v=zK4nXa84Km4.

The above is the detailed content of How to Open a Bootstrap Modal Window Using 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