[Javascript] Please help me

David Lovering dlovering at gazos.com
Thu Apr 29 00:19:31 CDT 2004


Without going into a rather lengthy analysis of the code, it looks like the
object/layer that contains the "drawing" layer has id 'ViewImage'.  If so,
you should be able to bring it to the foreground rather easily by simply
giving it the focus:

document.getElementById('ViewImage').focus();

This should be part of the body onLoad event handler so that it appears on
top at the very start.

-- Dave Lovering

----- Original Message ----- 
From: "Tult" <tult at dsp.com.vn>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Wednesday, April 28, 2004 8:25 PM
Subject: Re: [Javascript] Please help me


> Please help me!
>
>
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false"
> Inherits="WebApplication2.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');
>
>  xx=xpos-img.offsetLeft-2;
>  yy=ypos-img.offsetTop-2;
>
>
>  {
>   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');
>
>  xx=xpos-img.offsetLeft-2;
>  yy=ypos-img.offsetTop-2;
>
>  template.clipInit()
>  template.clipTo(0,0,0,0);
>
>
>  dragActive = false
>  document.getElementById('Textmouseup').value='mouseup';
>
>  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: 41px; POSITION:
> absolute; TOP: 33px" runat="server"
>     Width="267px" Height="217px"></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