jQuery UI : posisi dialog

Oleh : Abah Razi

بسم الله الرحمن الرحيم

Kode yang kita gunakan untuk mengatur posisi sebuah dialog di jQuery UI tampak seperti ini :


$( ".selector" ).dialog({ position: { my: "left top", at: "left bottom", of: button } });

Secara default posisi adalah center window atau


{ my: "center", at: "center", of: window }

Contoh implementasinya seperti berikut :




$(function() {

$( "#dialogkeranjang" ).click(function() {
$( "#dialog" ).dialog( "open" );
});

$("#dialog").dialog({
    autoOpen: false,
    title: 'Keranjang Belanja',
    position: { my: "left top", at: "left top", of: "#dialogkeranjang" },
    draggable: false,
    width : 800,
    height : 300,
    resizable : true,
    modal : true,
});
 
}); 



Silahkan merujuk ke utilitas posisi di jQuery UI untuk mempelajari tentang posisi ini lebih lanjut, karena implementasinya sama.

About Reza Ervani 426 Articles
Adalah pendiri programming.rezaervani.com -

Be the first to comment

Leave a Reply

Your email address will not be published.


*


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