• λ我爱Aspx >> Asp.Net >> ASP.NET 2.0+Atlas编写鼠标拖放程序
  • ASP.NET 2.0+Atlas编写鼠标拖放程序

  • :未知  Դ:非寒日志  :2007-4-21 0:50:20  ؼ:.net,asp.net,atlas,asp
  • <input type="button" value="Add Floating Div" onclick="createDraggableDiv();" /><div id="containerDiv" style="background-color:Purple;height:800px;width:600px;"/>

    这将允许你把很多的可拖放元素添加到你的页面上,这说明了,一旦你理解了在以声明方式使用Atlas和以编程方式使用它之间的关系,那么Atlas将表现出强大的威力和灵活性。作为参考,下面是动态拖放示例的完整实现代码:

    <%@ 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 runat="server"><title>Imperative Drag and Drop II</title><script type="text/javascript">function createDraggableDiv() { var panel= document.createElement("div"); panel.style.height="100px"; panel.style.width="100px"; panel.style.backgroundColor="Blue"; var panelHandle = document.createElement("div"); panelHandle.style.height="20px"; panelHandle.style.width="auto"; panelHandle.style.backgroundColor="Green"; panel.appendChild(panelHandle); var target = $('containerDiv').appendChild(panel); addFloatingBehavior(panel, panelHandle);}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();}</script></head><body><form id="form1" runat="server"><atlas:ScriptManager ID="ScriptManager1" runat="server"><Scripts><atlas:ScriptReference ScriptName="AtlasUIDragDrop" /></Scripts></atlas:ScriptManager><h2>Imperative Drag and Drop Code with javascript: demonstrate dynamic loading of behaviors</h2><input type="button" value="Add Floating Div" onclick="createDraggableDiv();" /><div id="containerDiv" style="background-color:Purple;height:800px;width:600px;"/></form></body></html>
    Ҷƪл˵?
  • һƪFLASH在浏览器中被提示激活(禁用)的解决办法
    һƪ9.18 75周年,勿忘国耻