DJKennedy
Dec-28-2006, 08:18 PM
I was given this code to remove the ability for someone to click on a gallery:
function doOnLoad()
{
if (window.AlbumID && window.AlbumID == "2257361") //
{
removeLinkFromImg();
}
}
function removeLinkFromImg()
{
var links = document.getElementsByTagName("A");
for (var i = 0; i < links.length; i++)
{
var link = links[i];
var divElm = link.parentNode;
if (!divElm) continue;
if (divElm.className.indexOf("photo")<0) continue;
link.href = "javascript:void(0);";
}
}
If I paste it twice and change the album ID to a different one, only one of these will work - using the code twice for two galleries does not work...is there other code I could use? Or am I needing to change something in the second piece?
Derek
function doOnLoad()
{
if (window.AlbumID && window.AlbumID == "2257361") //
{
removeLinkFromImg();
}
}
function removeLinkFromImg()
{
var links = document.getElementsByTagName("A");
for (var i = 0; i < links.length; i++)
{
var link = links[i];
var divElm = link.parentNode;
if (!divElm) continue;
if (divElm.className.indexOf("photo")<0) continue;
link.href = "javascript:void(0);";
}
}
If I paste it twice and change the album ID to a different one, only one of these will work - using the code twice for two galleries does not work...is there other code I could use? Or am I needing to change something in the second piece?
Derek