Here is what I'm trying to do
I have a hidden div, and when a link is clicked, that div will unhide (this is working). The data on the page is dynamic, so I want to dynamically position that div to unhide near the location of the link that is clicked.
Here is the function to dynmaically set the style:
And here is the HTML code (served up by ASP.Net)
lnkLogin is the name of my ASP.Net LinkButton control.
I am getting a compliation error when I try to do this, stating "Compiler Error Message: CS1026: ) expected" on the line of my HTML code.
Am I approaching setting the style the wrong way? I'm uncertain why I am getting this error, as I have no open bracets in my onload function of the div.
Your help with this is greatly appreciated!
I have a hidden div, and when a link is clicked, that div will unhide (this is working). The data on the page is dynamic, so I want to dynamically position that div to unhide near the location of the link that is clicked.
Here is the function to dynmaically set the style:
Code:
function getPosition(div, obj)
{
var yPos = getTop(document.getElementById(obj)) - 50;
var xPos = getLeft(document.getElementById(obj)) + 50;
if (yPos <= 0)
yPos = yPos + 100;
//return ("position: absolute; top: " + xPos + "px; left: " + yPos + "px;");
div.style.cssText = "z-Index:100;position: absolute; top: " + xPos + "px; left: " + yPos + "px;";
}
And here is the HTML code (served up by ASP.Net)
Code:
<div id="loginpopup" visible="true" runat="server" onload="javascript:getPosition(loginpopup, lnkLogin);">
lnkLogin is the name of my ASP.Net LinkButton control.
I am getting a compliation error when I try to do this, stating "Compiler Error Message: CS1026: ) expected" on the line of my HTML code.
Am I approaching setting the style the wrong way? I'm uncertain why I am getting this error, as I have no open bracets in my onload function of the div.
Your help with this is greatly appreciated!