[Javascript] Please help me

Hakan Magnusson hakan at backbase.com
Thu Apr 29 05:26:50 CDT 2004


Remove this code:

> Z-INDEX: 101; 

from your .net image control. That should solve it, since the "graphics" 
you are drawing are inserted after the image, they should appear "above" 
the image. Consider this:

<style type="text/css">
.posabs {
	position:absolute;
	left: 0px;
	top: 0px;
	width: 100px;
	height: 100px;
}
</style>

<div class="poasabs" style="background-color: red;"></div>
<div class="poasabs" style="background-color: green;"></div>
<div class="poasabs" style="background-color: blue;"></div>

Which colored box will you see when you view this code in a browser? The 
blue one, since none of them have a z-index they are all on the same 
"depth", but since the browser parsed the div with the blue background 
last, it will be above the other two.

Hope this helps.

Regards,
H.


Tult wrote:
>  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