jQuery : popup dialog dengan jQuery

Oleh : Abah Razi

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

Salah satu tips untuk menampilkan dialog yang berisi URL luar dengan jQuery UI adalah dengan menggunakan iframe seperti tampak pada contoh kode berikut ini :

1
2
3
4
<button id="dialog_trigger">Open</button>
 
<div id="dialog" style="display:none;" title="Dialog Title">
<iframe frameborder="0" scrolling="no" width="100%" height="100%" src="http://google.about.com/"></iframe></div>

Kode jQuerynya akan tampak seperti berikut

01
02
03
04
05
06
07
08
09
10
11
12
13
14
$( "#dialog_trigger" ).click(function() {
$( "#dialog" ).dialog( "open" );
});
$("#dialog").dialog({
    overflow: 'auto',
    autoOpen: false,
    position: 'center' ,
    title: 'test',
    draggable: true,
    width : 500,
    height : 400,
    resizable : true,
    modal : false,
});
About Reza Ervani 431 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.