I wonder if I could get a helping hand with this particular js code that I need for my portfolio gallery?
What I need is after the thumbnail is clicked and the larger image appears, the larger image would include a link at the bottom of the image that would take the viewer to a .pdf file.
Below is the script that I would like to use if possible. If there is any way I can tweak it to do what I need?
<script language="Javascript" type="text/javascript" src="script.js">
window.onload = initAll;
function initAll()
{
for(i=0; i<document.links.length; i++)
{
if(document.links.className == "newWin")
{
document.links.onclick = myNewWindow;
}
}
}
function myNewWindow()
{
var littleWindow = window.open(this.href, "ltWin", "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,width=600px,height=600px,left=300px,top=300px");
littleWindow.focus();
return false;
}
</script>
</head>
<body>
<a href="index.html"><img src="home.jpg" alt="home"></a>
<a href="imgbears.jpg" class="newWin"><img src="thimgbears.jpg" alt="picture of bears"></a>
<a href="imgcats.jpg" class="newWin"><img src="thimgcats.jpg" alt="picture of cat"></a>
<a href="imgcheetah.jpg" class="newWin"><img src="thimgcheetah.jpg" alt="picture of cheetah"></a>
<a href="imgdunes.jpg" class="newWin"><img src="thimgdunes.jpg" alt="picture of dunes"></a>
<a href="imggallaxy.jpg" class="newWin"><img src="thimggallaxy.jpg" alt="picture of gallaxy"></a>
<a href="imgjet.jpg" class="newWin"><img src="thimgjet.jpg" alt="picture of jet"></a>
<a href="imgnavy.jpg" class="newWin"><img src="thimgnavy.jpg" alt="picture of navy boat"></a>
<a href="imgocean.jpg" class="newWin"><img src="thimgocean.jpg" alt="picture of ocean"></a>
<a href="imgorion.jpg" class="newWin"><img src="thimgorion.jpg" alt="picture of orion"></a>
<a href="imgtree.jpg" class="newWin"><img src="thimgtree.jpg" alt="picture of tree"></a>
</body>
</html>
What I need is after the thumbnail is clicked and the larger image appears, the larger image would include a link at the bottom of the image that would take the viewer to a .pdf file.
Below is the script that I would like to use if possible. If there is any way I can tweak it to do what I need?
<script language="Javascript" type="text/javascript" src="script.js">
window.onload = initAll;
function initAll()
{
for(i=0; i<document.links.length; i++)
{
if(document.links.className == "newWin")
{
document.links.onclick = myNewWindow;
}
}
}
function myNewWindow()
{
var littleWindow = window.open(this.href, "ltWin", "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,width=600px,height=600px,left=300px,top=300px");
littleWindow.focus();
return false;
}
</script>
</head>
<body>
<a href="index.html"><img src="home.jpg" alt="home"></a>
<a href="imgbears.jpg" class="newWin"><img src="thimgbears.jpg" alt="picture of bears"></a>
<a href="imgcats.jpg" class="newWin"><img src="thimgcats.jpg" alt="picture of cat"></a>
<a href="imgcheetah.jpg" class="newWin"><img src="thimgcheetah.jpg" alt="picture of cheetah"></a>
<a href="imgdunes.jpg" class="newWin"><img src="thimgdunes.jpg" alt="picture of dunes"></a>
<a href="imggallaxy.jpg" class="newWin"><img src="thimggallaxy.jpg" alt="picture of gallaxy"></a>
<a href="imgjet.jpg" class="newWin"><img src="thimgjet.jpg" alt="picture of jet"></a>
<a href="imgnavy.jpg" class="newWin"><img src="thimgnavy.jpg" alt="picture of navy boat"></a>
<a href="imgocean.jpg" class="newWin"><img src="thimgocean.jpg" alt="picture of ocean"></a>
<a href="imgorion.jpg" class="newWin"><img src="thimgorion.jpg" alt="picture of orion"></a>
<a href="imgtree.jpg" class="newWin"><img src="thimgtree.jpg" alt="picture of tree"></a>
</body>
</html>