hi Danny,
I have an issue where i need to get to a particular element when i click on a menu button.It is working fine in IE but in firefox it doenst work.There is a literal to which i am binding data dynamically and i have assigned id's.When i click on menu, i pass id to javascript function to scroll down to that element which is dynamically bound to literal and i change back ground colours.But it doesnt work in FireFOX.
COULD YOU PLEASE HELP?When i try to capture the value of the element,like document .getElemnetById("a"),i get null.The literal is inside a div and literal to bound on runtime with data with Ids to which i ned to navigate.
<script type="text/javascript">
function Scroll(theElement) {
var selectedPosX = 0;
var selectedPosY = 0;
while (theElement != null) {
selectedPosX += theElement.offsetLeft;
selectedPosY += theElement.offsetTop;
theElement = theElement.offsetParent;
}
window.scrollTo(selectedPosX, selectedPosY);
}
function toggleBgColor(elem) {
var styleVal = elem.style;
styleVal .backgroundColor = styleVal .backgroundColor ? "" : "Green";
}
</script>
on menu click-i have something like
<ul>
<li><a id="" href=javascript:Scroll(a);javascript:ScrollToElement(a);"></a></li>
a is the id of the dynamic content am setting up in literal.
could you please help me?