Hmm...well..something is badly wrong, and I cnat figure out what....Im new to JS so...might need some help on this one...
This is my current code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>Untitled Page</title>
</head>
<form id="form1" runat="server">
<script language="javascript">
function findPos(){
var lb = document.getElementById("LB");
var div = document.getElementById("div1");
lb.style.left = div.style.left;
lb.style.top = div.style.top;
}
</script>
</head>
<body onload="findPos();">
<asp:LinkButton id="LB" runat="server">
Show/hide me
</asp:LinkButton>
<div id="div1" style="display: block; position:absolute; top: 240px; left: 422px;" >
This is the content
</div>
</body>
</html>
</form>
</body>
</html>
well I used ziomdk's code...but I cant understand whats wrong cause the layer(div1) aint getting parented