I am tring to flow a DIV element to the position where a row in a table
is clicked. I use the following javascript to caculate the mouse
position. The X and Y of the mouse is calculated correctly, but the DIV
does not flow there. The DIV always anchors top left corner of the
table, no matter how many far down the row is clicked. Does anyone know
why? Thanks.
<xsl:template match="/">
<form>
....
<xsl:apply-templates select="/adminrights/adminright"/>
</form>
<script language="JavaS cript">
<![CDATA[
var eTop, eLeft, myTarget; //page variables
var i=0; //page variables
function getPos(e)
{
if (!e) {e = window.event;}
else {myTarget = e.srcElement;}
eTop = myTarget.offset Top + 120;
eLeft = myTarget.offset Left;
}
var IE = document.all?tr ue:false
if (!IE) document.captur eEvents(Event.M OUSEMOVE)
document.onmous emove = getMouseXY;
document.onmous edown = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e)
{
if (IE)
{
tempX = event.clientX + document.body.s crollLeft
tempY = event.clientY + document.body.s crollTop
}
else
{
tempX = e.pageX
tempY = e.pageY
}
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
return true
}
]]>
</script>
</xsl:template>
<xsl:template match="adminrig ht">
<tr>
<xsl:attribut e name="onclick">
getPos(event);
with (document.getEl ementById("admi nRight"))
{
style.Top=eTop;
style.width="63 0px";
style.position= 'absolute';
style.backgroun d='#FFF';
style.display=' block';
}
</xsl:attribute>
</tr>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
is clicked. I use the following javascript to caculate the mouse
position. The X and Y of the mouse is calculated correctly, but the DIV
does not flow there. The DIV always anchors top left corner of the
table, no matter how many far down the row is clicked. Does anyone know
why? Thanks.
<xsl:template match="/">
<form>
....
<xsl:apply-templates select="/adminrights/adminright"/>
</form>
<script language="JavaS cript">
<![CDATA[
var eTop, eLeft, myTarget; //page variables
var i=0; //page variables
function getPos(e)
{
if (!e) {e = window.event;}
else {myTarget = e.srcElement;}
eTop = myTarget.offset Top + 120;
eLeft = myTarget.offset Left;
}
var IE = document.all?tr ue:false
if (!IE) document.captur eEvents(Event.M OUSEMOVE)
document.onmous emove = getMouseXY;
document.onmous edown = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e)
{
if (IE)
{
tempX = event.clientX + document.body.s crollLeft
tempY = event.clientY + document.body.s crollTop
}
else
{
tempX = e.pageX
tempY = e.pageY
}
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
return true
}
]]>
</script>
</xsl:template>
<xsl:template match="adminrig ht">
<tr>
<xsl:attribut e name="onclick">
getPos(event);
with (document.getEl ementById("admi nRight"))
{
style.Top=eTop;
style.width="63 0px";
style.position= 'absolute';
style.backgroun d='#FFF';
style.display=' block';
}
</xsl:attribute>
</tr>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Comment