「jQuery入門」モーダルダイアログを表示するサンプル

1.htmlコード
$('#testBtn’).click(function(){
$('#demo_dialog’).dialog('open’);
});
<div id="demo_dialog">
IT技術で世界を変わる
</div>

2.JSコード
$(“#demo_dialog").dialog({
title: 'jQueryダイアログのサンプル’,
dialogClass : 'demoClass’,
resizable : false,
modal : true,
buttons : {
“はい" : function() {
//処理コード1
$(this).dialog(“close");
},
“いいえ" : function() {
//処理コード2
$(this).dialog(“close");
}
}
});

jQuery

Posted by arkgame