我遇到了可拖动的问题。我正在制作一个窗口管理器式的系统,并希望拥有它,因此只能通过标题栏拖动窗口。问题是,出于某种原因,它不想做它应该做的事情。即使我清楚地将手柄设置为标题栏,它也允许我拖动所有内容。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="CSS/Primary.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="javascript/jquery-1.8.2.js">
</script>
<script type="text/javascript" src="javascript/jquery-ui-1.8.24.custom.min.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#LoginMinimize").click(function(){
$("#divLoginBox").toggle();
});
$("#LoginClose").click(function(){
$("#LoginContainer").remove();
});
$( "#divLoginTitleBar" ).draggable({
containment: 'window',
scroll: false,
handle: '#divLoginTitleBar'
});
});
</script>
<title>HEP Online --- Application Platform</title>
</head>
<body>
<div class="LoginContainer" id="LoginContainer">
<div id="divLoginTitleBar" class="TitleBar">
Login <div id="divTitleButtonBox" class="TitleButtonBox">
<img src="images/minimize.png" id="LoginMinimize" height="24px" />
<img src="images/close.png" id="LoginClose" height="24px" /></div>
<div id="divLoginBox" class="LoginBox">
<div id="divLoginContent" class="LoginContent">
<form method="post" action="" id="frmLogin">
<img src="images/loginsplash.png" />
<table id="tblLoginContent" class="LoginContent">
<tr>
<td>Username:</td>
<td>
<input maxlength="50" name="txtUsrName" size="20" type="text" /></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input maxlength="24" name="txtPassword" size="20" type="password" /></td>
</tr>
<tr>
<td><input name="btnLogin" type="submit" value="Login" /></td>
<td><input name="btnReset" type="reset" value="Reset" /></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</body>
</html>