Code:
<button onclick="open_dialog()">Click here for the dialog</button>
<div id="dialog" title="Dialog" style="display:none;">
<p>Bon jour.</p>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css"></link>
<script>
dialog = $("#dialog").dialog({
autoOpen: false,
//open:function(event,ui){$(".ui-dialog-titlebar-close").hide();},
modal: true,
draggable: true,
width: "50%",
show: "fade",
hide: "fade",
buttons:{
"Faire quelque chose":function(){
$(this).dialog('close');
},
"Fermer":function(){
$(this).dialog('close');
}
}
});
function open_dialog(){
dialog.dialog('open');
}
</script>
<div id="dialog" title="Dialog" style="display:none;">
<p>Bon jour.</p>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css"></link>
<script>
dialog = $("#dialog").dialog({
autoOpen: false,
//open:function(event,ui){$(".ui-dialog-titlebar-close").hide();},
modal: true,
draggable: true,
width: "50%",
show: "fade",
hide: "fade",
buttons:{
"Faire quelque chose":function(){
$(this).dialog('close');
},
"Fermer":function(){
$(this).dialog('close');
}
}
});
function open_dialog(){
dialog.dialog('open');
}
</script>
Aucun commentaire:
Enregistrer un commentaire