There is a problem when using the Easyui window (Windows), and when the form is dragged or resized, it will not return if it is out of the browser range.
Because the browser does not display scroll bars. Re-refresh the page as well.
So I wrote a way to implement the scoped form's active range (only visible in the browser's viewable range):
<div id= "Createschoolwindow" class= "Easyui-window" title= "New School"
data-options= "Modal:true,closed:true,minimizable:false,iconcls: ' Icon-add '"
Style= "width:530px; height:380px; padding:10px; " >
<form id= "Createschoolform" method= "POST" >
<table>
<tr>
<td> School Name:</td>
<td><input class= "Easyui-validatebox" type= "text" name= "name" data-options= "Required:true" ></input ></td>
<td> School website:</td>
<td><input class= "Easyui-validatebox" type= "text" name= "WebSite" data-options= "validtype: ' url '"/></ Input></td>
</tr>
<tr>
<td> Contact person Name:</td>
<td><input class= "Easyui-validatebox" type= "text" name= "Linkman" ></input></td>
<td> Contact Phone:</td>
<td><input class= "Easyui-validatebox" type= "text" name= "Linkmanphone" ></input></td>
</tr>
<tr>
<td> School Address:</td>
<TD colspan= "3" ><textarea rows= "4" cols= "name=" addr "></textarea></td>
</tr>
<tr>
<td> remarks:</td>
<TD colspan= "3" >
<textarea rows= "4" cols= "name=" remark "></textarea>
</td>
</tr>
<tr>
<TD colspan= "4" align= "Center" >
<a href= "#" class= "Easyui-linkbutton" onclick= "Createschool ()" icon= "Icon-save" > Save </a>
<a href= "#" class= "Easyui-linkbutton" onclick= "Closecreateschoolwindow ()" icon= "Icon-cancel" > Close </a>
</td>
</tr>
</table>
</form>
</div>
/*
The principle is simple: to register OnMove and onresize events, the cross-border is auto-reply:
*/
$ (document). Ready (function () {
$ ("#createSchoolWindow"). Window ({
Onmove:function (left,top) {
Console.log (this.left+ "-" +top);
if (left<0) {
$ ("#createSchoolWindow"). Window ("resize", {left:0});
}
if (top<0) {
$ ("#createSchoolWindow"). Window ("resize", {top:0});
}
},
Onresize:function (width, height) {
var w=$ (window). width ();//Visible width
var h=$ (window). height ();//Visible height
var left=$ ("#createSchoolWindow"). Window ("Options"). left;//form left distance
var top=$ ("#createSchoolWindow"). Window ("Options"). top;//form Right Distance
if ((width+left) >w) {
$ ("#createSchoolWindow"). Window ("resize", {width:w-left});
}
if ((height+top) >h) {
$ ("#createSchoolWindow"). Window ("resize", {height:h-top});
}
}
});
});
Easyui Windows (window) cross-border problem--limit Easyui window activity range