[Javascript] {Virus?}Please help me

David Lovering dlovering at gazos.com
Mon May 3 08:02:17 CDT 2004


I'm not the brightest bulb in the batch, but maybe you should try commenting
out the "template.hide()" declaration in the init() routine, or at the very
least undo its effects when you want the back layer to become the front
layer (and vice-versa).

-- Dave Lovering

----- Original Message ----- 
From: "Tult" <tult at dsp.com.vn>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Monday, May 03, 2004 1:13 AM
Subject: Re: [Javascript] {Virus?}Please help me


> Hi!
> I'm using asp.net to draw a rectangle on an image .jpg but rectangle
display
> behind of .jpg, please help me draw a rectangle front of image .jpg,
> this is code i use to draw a rectangle.
> thanks,
>
>
>
>
>
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false"
> Inherits="WebApplication3.WebForm1" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <HTML>
>  <HEAD>
>   <title>WebForm1</title>
>   <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
>   <meta name="CODE_LANGUAGE" Content="C#">
>   <meta name="vs_defaultClientScript" content="JavaScript">
>   <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
>   <SCRIPT language="JavaScript" src="dynlayer.js"></SCRIPT>
>   <SCRIPT language="JavaScript" src="createdestroy.js"></SCRIPT>
>   <SCRIPT language="JavaScript">
>
>
> ns4 = (document.layers)? true:false
>
> ie4 = (document.all)? true:false
>
> function init() {
>         createLayer('templateDiv',null,0,0,800,600,'','#C0C0C0');
>         template = new DynLayer("templateDiv")
>         template.hide();
>
>         document.getElementById('ViewImage').onmousedown=doWork_mousedown
>         document.getElementById('ViewImage').onmousemove=doWork_mousemove
>         document.getElementById('ViewImage').onmouseup=doWork_mouseup
>         //if (ns4) document.captureEvents(Event.MOUSEDOWN |
> Event.MOUSEMOVE )//| Event.MOUSEUP
>
>         dragActive = false
>
> }
>
>  clickx = ""
>  clicky = ""
>
> //*****************************************
>
> function doWork_mousemove(e)
> {
>  var x = (ns4)? e.pageX : event.x
>  var y = (ns4)? e.pageY : event.y+document.body.scrollTop
>
>
if(document.all){xpos=window.event.x+document.body.scrollLeft;ypos=window.ev
> ent.y+document.body.scrollTop;}
>  var img=document.getElementById('ViewImage');
>  //document.body.appendChild(img);
>  xx=xpos-img.offsetLeft-2;
>  yy=ypos-img.offsetTop-2;
>
>  //document.getElementById('TextBox2').value='x= '+xx+' | y ='+yy;
>  if(dragActive)
>  {
>   template.clipInit()
>   template.clipTo(clicky,x,y,clickx)
>  }
>
> }
>
>
> function doWork_mouseup(e)
> {
>  var x = (ns4)? e.pageX : event.x
>     var y = (ns4)? e.pageY : event.y+document.body.scrollTop
>
>
if(document.all){xpos=window.event.x+document.body.scrollLeft;ypos=window.ev
> ent.y+document.body.scrollTop;}
>  var img=document.getElementById('ViewImage');
>  //document.body.appendChild(img);
>  xx=xpos-img.offsetLeft-2;
>  yy=ypos-img.offsetTop-2;
>  //var numLayer = (x-clickx)
>  template.clipInit()
>  template.clipTo(0,0,0,0);
>
>  dragActive = false
>
>  document.Form1.submit();
> }
>
>
> function doWork_mousedown(e)
> {
>   if ((ns4 && e.which == 1) || ie4) {
>
>   template.show();
>   var x = (ns4)? e.pageX : event.x
>   var y = (ns4)? e.pageY : event.y+document.body.scrollTop
>
>
>
if(document.all){xpos=window.event.x+document.body.scrollLeft;ypos=window.ev
> ent.y+document.body.scrollTop;}
>   var img=document.getElementById('ViewImage');
>
>   xx=xpos-img.offsetLeft-2;
>   yy=ypos-img.offsetTop-2;
>
>
>   clickx = x
>   clicky = y
>
>   dragActive = true
>
>   return false
>      }
>      else return true
> }
>
>   </SCRIPT>
>  </HEAD>
>  <BODY onload="init()" ms_positioning="GridLayout">
>   <form id="Form1" method="post" runat="server">
>    <asp:Image id="ViewImage" style="Z-INDEX: 101; LEFT: 521px; POSITION:
> absolute; TOP: 85px"
>     runat="server" Width="187px" Height="194px"></asp:Image>
>   </form>
>  </BODY>
> </HTML>
>


----------------------------------------------------------------------------
----


> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list