Resize Window Onload Javascript
Fri, 12 Feb 2010 23:19:28 +0000
Tublogaqui.blogspot.com | DiseƱo de Design Disease | A Blogger por Blog and Web
my code is Drag and drop image in javascript<script language="javascript" type="text/javascript"> var dropZoneArray = new Array(5); dropZoneArray[0] = "Image1"; var mouseState = 'up'; function MakeElementDraggable(obj) { var startX = 0; var startY = 0; function InitiateDrag(e) { var evt = e || window.event; startX = parseInt(evt.clientX); startY = parseInt(evt.clientY); obj.style.top = parseInt(startY) + 'px'; obj.style.left = parseInt(startX) + 'px'; document.onmousemove = Drag; document.onmouseup = Drop; return false; } function Drop(e) { var evt = e || window.event; // check that if we are in the drop zone if(IsInDropZone(evt)) { document.onmouseup = null; document.onmousemove = null; } } function Drag(e) { // only drag when the mouse is down var dropZoneObject; var evt = e || window.event; obj.style.top = evt.clientY + 'px'; obj.style.left = evt.clientX + 'px'; // Check if we are in the drop Zone if(IsInDropZone(evt)) { dropZoneObject = evt.srcElement; dropZoneObject.className = 'highlightDropZone'; } else { ResetColor(); } } a.onmousedown = InitiateDrag; } function ResetColor() { document.getElementById("Image1").className = 'DefaultDropZoneColor'; } function IsInDropZone(evt) { var result = false; var obj = evt.srcElement; // iterate through the array and find it the id exists for(i = 0; i < dropZoneArray.length; i++) { if(obj.id == dropZoneArray[i]) { result = true; break; } } return result; } // make the element draggable window.onload = MakeElementDraggable(document.getElementById("a")); </script> -------------------- aspx code <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Drag and Drop Demo</title> <link href="Site.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <div> <div id="a" class="dragElement" style="left: 112px; width: 43px; top: 27px; height: 5px; z-index: 102;"> <asp:Image ID ="lbldsf" runat ="server" Height="51px" ImageUrl="~/ImageJewellry/Pendants/Style15.PNG" Width="54px" /></div> <br /> <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label><br /> <br /> <br /> <br /> <div id="dZone" style="position:absolute; top:163px; right:284px; width:135px; height:164px; z-index: 100;" class="DefaultDropZoneColor"> rop Zone <asp:Image ID="Image1" runat="server" Height="347px" ImageUrl="~/ImageJewellry/Model/model1.bmp" Width="444px" />1 </div> </form >
but i want to do
i drag or select one image from collection after drop on other image where need me against i adjust image by crop.resize,adjust perticular location and compose both image after i click outer side in asp.net.




