Hello,
Firstly, I have found a script, I did a little bit of chopping and changing, and on a single page it works great as all of the javascript is currently internal, but I want to adapt the script a little bit.
Here are 2 scripts what resides in my <head></head>
[B]<script type=”text/javascript” language=”JavaScript”><!–
function HideContent(d) {
document.getElementById(d).style.display = “none”;
}
function ShowContent(d) {
document.getElementById(d).style.display = “block”;
}
function ReverseContentDisplay(d) {
if(document.getElementById(d).style.display == “none”) { document.getElementById(d).style.display = “block”; }
else { document.getElementById(d).style.display = “none”; }
}
//–></script>
<SCRIPT language=”JavaScript”>
<!–hide
function newwindow()
{
window.open(‘
}
//–>
</SCRIPT>
Here is the code that I use for my link in <BODY></BODY>:
[B]<a href=”javascript:newwindow();ShowContent(‘content’)”>Link to open page
<div id=”content” style=”display:none;”>THIS IS WHERE HIDDEN CONTENT WILL APPEAR WHEN MY LINK IS CLICKED</div>
When the link is clicked it reveals the content and opens a window to a new page/site.
What I want to do is to adapt the javascript so I am able to add more than 1 link I can open, and I want to make the <HEAD> javascript external. I tried to do it but the code wouldn’t reveal itself in the <div> tags in the body. Basically, I want to make use of it in a blog where all of the php files use the same header, so I am limited to the same script for every page.
Is it possible to add newwindow2 or something so I can add another link, and how do I make the link call onto an external javascript? Currently, as I see it, it is calling on the internal script.
So I would have something like:
I hope this makes sense, I am not too well up on javascript but I really need to get this working.
TIA
Terry ?