Membuat select2 responsive


 

Kali ini share lagi tips membuat select2 menjadi responsive mengikuti lebar dari column di bootstrap, saya tidak akan menceritakan bagaimana cara menggunakan select2, cari sendiri di google banyak :).

So begini caranya cukup tambahkan window resize function menjadi seperti dibawah ini

    $(document).ready(function() {
      $(".select2").select2();
      $(window).resize(function() {
    $('.select2').css('width', "100%");
});

    });
    

Sudah gitu aja simple kan, semoga bermanfaat happy coding.

Advertisement

Published by

susiloharjo

Khoirunnas anfa'ahum linnas A Father, Husband and love to learn person Love my Family, Electronics, Photography, Robot, Dreaming, Programming

Ditunggu komennya ...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.