1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <div id="dialog" title="Dialog Title">I'm in a dialog</div>
<a id="diag1">diag1</a> <a id="diag2">diag2</a>
<script type="text/javascript">
$(document).ready(function() {
$('a').click(function(){
if( $(this).attr('id') == "diag1" )
{
$('#dialog').attr('title',"diag1");
$('#dialog').html("Ceci est la boite 1");
}
else
if( $(this).attr('id') == "diag2" )
{
$('#dialog').attr('title',"diag2");
$('#dialog').html("Ceci est la boite 2");
}
$("#dialog").dialog();
});
});
</script> |
Partager