扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:朱先忠编译 来源:天极软件 2007年11月6日
关键字: Windows
function addDropZoneBehavior(ctrl){ var dropZone = new Sys.UI.Control(ctrl); var dropZoneBehavior = new Custom.UI.DropZoneBehavior(); dropZone.get_behaviors().add(dropZoneBehavior); dropZoneBehavior.initialize(); } |
<%@ Page Language="C#" %> <!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 id="Head1" runat="server"> <title>Imperative Drop Targets</title> <script type="text/javascript"> function addFloatingBehavior(ctrl, ctrlHandle){ var floatingBehavior = new Sys.UI.FloatingBehavior(); floatingBehavior.set_handle(ctrlHandle); var dragItem = new Sys.UI.Control(ctrl); dragItem.get_behaviors().add(floatingBehavior); floatingBehavior.initialize(); } function addDropZoneBehavior(ctrl){ var dropZone = new Sys.UI.Control(ctrl); var dropZoneBehavior = new Custom.UI.DropZoneBehavior(); dropZone.get_behaviors().add(dropZoneBehavior); dropZoneBehavior.initialize(); } function pageLoad(){ addDropZoneBehavior($('dropZone')); addFloatingBehavior($('draggableDiv'),$('handleBar')); } </script> </head> <body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <atlas:ScriptReference ScriptName="AtlasUIDragDrop" /> <atlas:ScriptReference Path="scriptLibrary/DropZoneBehavior.js" /> </Scripts> </atlas:ScriptManager> <h2>Imperative Drop Targets with javacript</h2> <div style="background-color:Red;height:200px;width:200px;"> <div id="draggableDiv" style="height:100px;width:100px;background-color:Blue;"> <div id="handleBar" style="height:20px;width:auto;background-color:Green;"> </div> </div> </div> <div id="dropZone" style="background-color:cornflowerblue; height:200px;width:200px;">Drop Zone</div> </form> </body> </html> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者