Bonjour!
I'm using a simple JavaScript peekaboo code to allow hiding of content until requested. I've used to code before but this time am encountering a bit of a problem:
when the trigger link is clicked, the top of the page is targetted. Each of these links is given
href="#". In addition, the section will only expand after the trigger link is clicked once more. The site is based off of a university template, so I have a feeling the issue might be a conflict with other code surrounding the content, but I can't figure it out.
In head:
Code:
<script type="text/javascript">
function toggleview(element1) {
element1 = document.getElementById(element1);
if (element1.style.display == 'block' || element1.style.display == '')
element1.style.display = 'none';
else
element1.style.display = 'block';
return;
}
</script>
In stylesheet:
Code:
.extra {
display: none;
}
Content code:
Code:
<a href="#" onclick="toggleview('q1')">[show]</a>
<p id="q1" class="extra">
Hide Me
</p>
Example pages:http://music.york.ac.uk/new/prospect...aduate/faq.php
http://music.york.ac.uk/new/staff/pr...wainwright.php
Any and all help is greatly appreciated!