VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-modal-handleupdate-method/

⇱ Bootstrap 5 Modal handleUpdate() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Modal handleUpdate() Method

Last Updated : 26 Jul, 2024

A website can have dialogues added for lightboxes, user notifications, or entirely unique content by using Bootstrap modals. Modal development uses JavaScript, CSS, and HTML. If the modal height changes so that it exceeds the viewport height while it is open, handleUpdate() Method repositions the modal to compensate for the shock caused by the presence of the viewport scrollbar.

Syntax:

myModal.handleUpdate()

Example 1: The example below demonstrates how we can implement the Modal handleUpdate() Method using JavaScript:

Output:

Example 2: The code below demonstrates how we can implement the Modal handleUpdate() Method using jQuery:

Output:

Reference: https://getbootstrap.com/docs/5.0/components/modal/#handleupdate

Comment

Explore