One way is to have the page automatically scroll to where the header that's just been clicked on each time it's clicked on. To do this, firstly, add the below function to the script itself:
Code:
function bringtoview(what){
if (what.scrollIntoView)
what.scrollIntoView()
}
Then, inside the HTML for your headers, add the below:
Code:
<h3 onClick="expandcontent('sc1'); bringtoview(this)" style="cursor:hand; cursor:pointer">What is JavaScript?</h3>
The part in red is new- basically what will happen now is whenever the user clicks on the "What is JavaScript" header, the page will scroll to it if it's out of view. This may help in your case.
Bookmarks