Hello,
In my site I have a link and you click on it, it runs a javascript function where it gets makes a div visable. This is so people can click the link and get a defintion of a word.
Here is the link:
[HTML]<a href="#" onclick="toggle _visibility('pr ocessIslands'); ">(What are Process Islands?)</a>
[/HTML]
Here is the Div:
[HTML] <div id="processIsla nds" style="display: none"> Text in the Div </div>
[/HTML]
And here is the function that is called:
[CODE=javascript] function toggle_visibili ty(id) {
var div = document.getEle mentById(id);
if(div.style.di splay == 'block')
div.style.displ ay = 'none';
else
div.style.displ ay = 'block';
}
[/CODE]
My problem, is that when I use this as it is, it will show the div, but then it jumps to the top of the page. How can I set the focus of the page to that Div so the user doesn't have to scroll down and find where they were?
I am using asp.net C# Visual Studio 2005.
Thanks!
In my site I have a link and you click on it, it runs a javascript function where it gets makes a div visable. This is so people can click the link and get a defintion of a word.
Here is the link:
[HTML]<a href="#" onclick="toggle _visibility('pr ocessIslands'); ">(What are Process Islands?)</a>
[/HTML]
Here is the Div:
[HTML] <div id="processIsla nds" style="display: none"> Text in the Div </div>
[/HTML]
And here is the function that is called:
[CODE=javascript] function toggle_visibili ty(id) {
var div = document.getEle mentById(id);
if(div.style.di splay == 'block')
div.style.displ ay = 'none';
else
div.style.displ ay = 'block';
}
[/CODE]
My problem, is that when I use this as it is, it will show the div, but then it jumps to the top of the page. How can I set the focus of the page to that Div so the user doesn't have to scroll down and find where they were?
I am using asp.net C# Visual Studio 2005.
Thanks!
Comment