如何设置CSS符合框?

时间:2011-06-22 10:13:39

标签: javascript-events

我写了脚本以符合box.but我不知道如何设置CSS符合框也ok和取消按钮........如何设置....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Control Panel</title>
</head>
<body>
<button class=" "   id="id2" >Start Thermonuclear War</span></button>
 <div title="Why so serious?" id="id3" style="display:none;">
<p> You are about to start a war. 
<p>Click OK to confirm. Click Cancel to cancel this action.</p>
</div>
</body>
<script type="text/javascript" >
$('#id2').click(function(event){
if($(this).data('propagationStopped')){

$(this).data('propagationStopped', false);
return true;
}else{

event.stopImmediatePropagation();

$('#id3').dialog({

width: 600,
buttons: {
"Ok": function() { 
$(this).dialog("close"); 
$('#id2').data('propagationStopped', true);

$('#id2').triggerHandler(event);
 location.href = 'index.php';
}, 
"Cancel": function() { 
$(this).dialog("close"); 
return false; 
} 
}
});

return false;   
}
});
</script>

</html>

1 个答案:

答案 0 :(得分:0)

请看这里:主题下的http://jqueryui.com/demos/dialog/