Cara menggunakan bootstrap modal not working

Change the size of the modal by adding the .modal-sm class for small modals, .modal-lg class for large modals, or .modal-xl for extra large modals.

Add the size class to the

element with class .modal-dialog:

By default, modals are "medium" in size.


Centered Modal

Center the modal vertically and horizontally within the page, with the .modal-dialog-centered class:


Scrolling Modal

When you have a lot of content inside the modal, a scrollbar is added to the page. See the examples below to understand it:

However, it is possible to only scroll inside the modal, instead of the page itself, by adding .modal-dialog-scrollable to .modal-dialog:


Complete Bootstrap Modal Reference

For a complete reference of all modal options, methods and events, go to our Bootstrap JS Modal Reference.

Change the size of the modal by adding the .modal-sm class for small modals (max-width 300px), .modal-lg class for large modals  (max-width 800px), or .modal-xl for extra large modals  (max-width 1140px). Default is 500px max-width.

Add the size class to the

element with class .modal-dialog:

By default, modals are "medium" in size (500px max-width).


Fullscreen Modals

If you want the modal to span the whole width and height of the page, use the .modal-fullscreen class:


Responsive Fullscreen Modals

You can also control when the modal should be in fullscreen, with the .modal-fullscreen-*-* classes:

ClassDescriptionExample.modal-fullscreen-sm-downFullscreen below 576pxTry it.modal-fullscreen-md-downFullscreen below 768pxTry it.modal-fullscreen-lg-downFullscreen below 992pxTry it.modal-sm0Fullscreen below 1200pxTry it.modal-sm1Fullscreen below 1400pxTry it

Centered Modal

Center the modal vertically and horizontally within the page, with the .modal-sm2 class:


Scrolling Modal

When you have a lot of content inside the modal, a scrollbar is added to the page. See the examples below to understand it:

However, it is possible to only scroll inside the modal, instead of the page itself, by adding .modal-sm3 to .modal-dialog:

Modal adalah sebuah kotak dialog atau sering di sebut dengann popup yang menampilkan pesan atau konfirmasi untuk suatu aksi, anda bisa membuat promosi dengan modal, membuat persetujuan untuk suatu aksi, misalnya anda membuat aksi untuk menghapus suatu data maka anda bisa menggunakan modal untuk membuat pertanyaan konfirmasi seperti misalnya “apakah anda yakin ingin menghapus data ini ?”. banyak lagi kegunaan dari modal karena anda juga bisa menampilkan data dalam bentuk modal.

Bootstrap menyediakan sebuah plugin modal yang bisa di gunakan dengan sangat mudah. membuat modal dengan bootstrap caranya sangat mudah. perhatikan penjelasan modal bootstrap berikut ini.

Cara membuat modal dengan bootstrap

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

<!DOCTYPE html>

<html>

<head>

<title>Bootstrap Part 15 : Membuat Modal dengan Bootstrap</title>

<link rel="stylesheet" type="text/css" href="css/bootstrap.css">

<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript" src="js/bootstrap.js"></script>

</head>

<body>

   <div class="container">

<center><h1>Membuat Modal dengan Bootstrap | www.malasngoding.com</h1></center>

<br/>

<!-- Tombol untuk menampilkan modal-->

<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Buka Modal</button>

 

<!-- Modal -->

<div id="myModal" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- konten modal-->

<div class="modal-content">

<!-- heading modal -->

<div class="modal-header">

<button type="button" class="close" data-dismiss="modal">&times;</button>

<h4 class="modal-title">Bagian heading modal</h4>

</div>

<!-- body modal -->

<div class="modal-body">

<p>bagian body modal.</p>

</div>

<!-- footer modal -->

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">Tutup Modal</button>

</div>

</div>

</div>

</div>

   </div>

</body>

</html>

Dan hasilnya saat tombol di klik

Cara menggunakan bootstrap modal not working

membuat modal dengan bootstrap

penjelasan contoh membuat modal di atas, perhatikan pada atribut

1

data-target="#myModal"

pada tombol, isi dari atribut tersebut menentukan id modal yang akan di munculkan jika tombol tersebut di klik. perhatikan pada contoh modal di atas

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

<div id="myModal" class="modal fade" role="dialog">

   <div class="modal-dialog">

<!-- konten modal-->

<div class="modal-content">

<!-- heading modal -->

<div class="modal-header">

<button type="button" class="close" data-dismiss="modal">&times;</button>

<h4 class="modal-title">Bagian heading modal</h4>

</div>

<!-- body modal -->

<div class="modal-body">

<p>bagian body modal.</p>

</div>

<!-- footer modal -->

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">Tutup Modal</button>

</div>

</div>

   </div>

</div>

class “fade” di atas berfungsi untuk memberi efek fade atau memudar pada saar pemunculan dan penutupan modal.

1

data-dismiss="modal"

atribut data-dismiss seperti di atas berfungsi untuk menutup modal. kemudian lagi modal memiliki bagian kepala atau heading, body dan footer.

1

2

3

4

5

6

7

8

9

10

11

12

<div class="modal-header">

<button type="button" class="close" data-dismiss="modal">&times;</button>

<h4 class="modal-title">Bagian heading modal</h4>

</div>

<!-- body modal -->

<div class="modal-body">

<p>bagian body modal.</p>

</div>

<!-- footer modal -->

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">Tutup Modal</button>

</div>

Untuk mengatur ukuran modal yang ingin di tampilkan anda bisa menambahkan class “modal-sm” untuk menampilkan modal dengan ukuran kecil pada element modal-dialog. dan tambahkan class “modal-lg” untuk menampilkan modal dengan ukuran besar. 

See the Pen BjRWxa by Malas Ngoding (@malasngoding) on CodePen.0

Sekian lah tutorial bootstrap part 15 : Membuat modal dengan bootstrap.

Tutorial Bootstrap Dasar Lainnya

Bootstrap Part 1 : Pengertian dan Cara Menggunakan Bootstrap
Bootstrap Part 2 : Membuat Table dengan Bootstrap
Bootstrap Part 3 : Tampilan Gambar dengan Bootstrap
Bootstrap Part 4 : Membuat Tombol dengan Bootstrap
Bootstrap Part 5 : Membuat Jumbotron dengan Bootstrap
Bootstrap Part 6 : Membuat Pesan Alert dengan Bootstrap
Bootstrap Part 7 : Cara Membuat Icon dengan Bootstrap
Bootstrap Part 8 : Pagination dan Breadcrumb dengan Bootstrap
Bootstrap Part 9 : Membuat List dengan Bootstrap
Bootstrap Part 10 : Membuat Panel dengan Bootstrap
Bootstrap Part 11 : Membuat Navigasi Tabs dan Pills dengan Bootstrap
Bootstrap Part 12 : Membuat Navigation Bar Bootstrap
Bootstrap Part 13 : Membuat Form dengan Bootstrap
Bootstrap Part 14 : Membuat Carousel dengan Bootstrap
Bootstrap Part 15 : Membuat Modal dengan Bootstrap
Bootstrap Part 16 : Mengenal System Grid Bootstrap

Incoming search terms:

  • membuat modal bootstrap
  • malasngoding bootstrap
  • cara membuat modal bootstrap
  • cara membuat modal html
  • membuat popup dengan bootstrap
  • membuat modal dengan bootstrap
  • membuat crud dengan modal bootstrap
  • tutorial membuat pop
  • cara membuat modal dengan bootstrap
  • cara membuat modal


  • SHARE :

Diki Alfarabi Hadi

Coding enthusiast. Someone who love learn something new. especially about web programming and web design. happy to share about knowledge and learn from other.

  • Author's profile
  • All posts by Diki Alfarabi Hadi

Tags: bootstrap modal, cara membuat modal, cara mudah belajar bootstrap, menampilkan modal, menampilkan modal dengan bootstrap, modal bootstrap, modal dialog bootstrap

Tutorial Bootstrap Dasar

  • #1. Pengenalan Bootstrap
  • #2. Tabel Bootstrap
  • #3. Menampilkan Gambar
  • #4. Tombol Bootstrap
  • #5. Jumbotron Bootstrap
  • #6. Alert Bootstrap
  • #7. Icon Bootstrap
  • #8. Pagination dan Breadcrumb
  • #9. List Bootstrap
  • #10. Panel Bootstrap
  • #11. Tabs dan Pills Bootstrap
  • #12. Navigation Bar Bootstrap
  • #13. Form Bootstrap
  • #14. Carousel Bootstrap
  • #15. Modal Dialog Bootstrap
  • #16. Grid Sistem Bootstrap
  • #17. Membuat Template Dengan Bootstrap
  • #18. Tutorial Bootstrap Lainnya

Produk

  • Cara menggunakan bootstrap modal not working
    Source Code Website Reservasi Kamar Hotel Dengan PHP dan MySQLi Rp 200,000
  • Cara menggunakan bootstrap modal not working
    Source Code Aplikasi Pengajuan Cuti Karyawan Berbasis Website Rp 200,000
  • Cara menggunakan bootstrap modal not working
    Source Code Toko Sport PHP dan MySQLi Rp 200,000
  • Cara menggunakan bootstrap modal not working
    Source Code Sistem Informasi Kuesioner Berbasis Web Rp 200,000

Tutorial Terbaru

  • Tutorial Python # 13 : Jenis Operator Pada Python September 24, 2022
  • Membuat Laporan PDF Dengan PHP dan MySQLi September 3, 2022
  • Export Data ke Excel Dengan PHP dan MySQLi August 23, 2022
  • Membuat Select Option Dinamis Menggunakan Ajax August 17, 2022
  • Membuat QR Code Dengan PHP August 3, 2022

Toko Kami

Cara menggunakan bootstrap modal not working
Cara menggunakan bootstrap modal not working
Cara menggunakan bootstrap modal not working

SOCIAL

Malas Ngoding

TUTORIAL MENARIK LAINNYA

Cara menggunakan bootstrap modal not working

Bootstrap - Web Design

Membuat Template Blog Sederhana Dengan Bootstrap

4 April 2016

Membuat Template Blog Sederhana Dengan Bootstrap Membuat Template Blog Sederhana Dengan Bootstrap – Template website adalah salah satu yang terpenting. template mencerminkan mutu atau kualitas ...

Diki Alfarabi Hadi

Cara menggunakan bootstrap modal not working

Bootstrap

Bootstrap Part 16 : Mengenal Grid System Bootstrap

8 January 2016

Mengenal Grid System Bootstrap Grid System pada bootstrap merupakan pengaturan ukuran yang di tampilkan pada monitor. grid system berfungsi untuk membuat pengaturan untuk lebar dari ...

Diki Alfarabi Hadi

Cara menggunakan bootstrap modal not working

Bootstrap8 January 2016

Membuat Carousel Dengan Bootstrap Carousel atau sering juga di sebut slideshow merupakan proses penampilan gambar-gambar yang di beri efek slide. sangat banyak website atau situs ...

Diki Alfarabi Hadi

Cara menggunakan bootstrap modal not working

Bootstrap

Bootstrap Part 13 : Membuat Form Dengan Bootstrap

8 January 2016

Membuat Form Dengan Bootstrap Sebelumnya pada tutorial belajar bootstrap part-part sebelumnya di www.malasngoding.com saya sudah menjelaskan tentang penggunaan macam-macam komponen bootstrap seperti membuat tombol dengan ...