The. NET Floating window drag implementation method. Also mentioned is a jquery plug-in Easydrag, this plug-in processing drag release is useful, but since I last modified, now I found another bug. In a page where Easydrag is applied, a script error that "object cannot be found" appears when the page loads. After careful examination, the problem was found to be the early binding of the document in Easydrag MouseMove and MouseUp events, and sometimes the script loaded when the document is not ready, nature will "not find the object".
The solution to the problem is simple, and we postpone the binding of these two events:
以下为引用的内容:
function mousemove_handler(e){
//
}
function mouseup_handler(e){
//
// 解除鼠标移动和弹起事件的处理函数绑定
$(document).unbind("mousemove", mousemove_handler).unbind("mouseup", mouseup_handler);
}
$("#拖动目标").mousedown(function(){
//
// 添加鼠标移动和弹起事件的处理函数绑定
$(document).mousemove(mousemove_handler).mouseup(mouseup_handler);
})
Note that the Unbind event is also necessary in the code above.
Also recommend a good jquery plugin--background iframe.
We used to write calendar controls in the Web page to cover the effects of <select>.
The invocation method is also very simple:
以下为引用的内容:
<div>
<iframe></iframe>
</div>
To load the pop-up content. But there is a problem, that is, the loaded document and the current document is not a page, then in the ASP.net and other background code, it is not very convenient to do data binding, because more than one page, you need more than a lot of unnecessary variable transfer work.
The principle of background iframe is that you can write the pop-up content directly in the <div></div> of the current page, it is responsible for dynamically inserting a transparent IFRAME as the background mask in this div, which can also achieve occlusion <select> effect.
The invocation method is also very simple:
以下为引用的内容:
$("#some_layer").bgiframe();
That's it.
It is thought that programming is really the most important idea. Remember the past to see Meizz Calendar control code, through the way of the IFrame to write, realize very complex, now if the background iframe this idea, the problem is very simple to solve.