I'm trying to accomplish a thumbnail view using javascript. So far it all works pretty good, except when I go from an image that is larger than my set dimensions to an images that is smaller, I want to be able to remove the "link". Right now, I'm just setting the href to '', however in IE7 (possibly IE6), if I click on it, it takes me to the Url: '' which is not like # (in firefox) but more like " I want the link to be removed altogether. See the link is simply viewing the file in a new window. I don't want it to do that if the image is already as large as it can be. So, what i'm asking is, in my function, is it possible to just to make the link not work?
This is the function that changes the larger image source (which is 250px in height). And I have PHP code that sets TRUE or FALSE if it is larger than 250px.
_______________
_brian.
This is the function that changes the larger image source (which is 250px in height). And I have PHP code that sets TRUE or FALSE if it is larger than 250px.
Code:
function setSource(filename,caption,larger){
document.getElementById("mainimg").src = "phpThumb/phpThumb.php?src=../"+filename+"&h=250";
if(larger == "true"){
document.getElementById("fullimg").href = filename;
document.getElementById("fullimg").target = "fullsize";
document.getElementById("mainimg").style.cursor = "pointer";
document.getElementById("mainimg").title = caption+" [click for larger view]";
document.getElementById("mainimg").alt = caption+" [click for larger view]";
document.getElementById("imgcaption").innerHTML = caption+" <span style=\"font-size:10px;\">[<a href=\""+filename+"\" target=\"fullsize\">click for larger view</a>]</span>";
} else {
document.getElementById("fullimg").href = '';
document.getElementById("fullimg").target = "_parent";
document.getElementById("mainimg").style.cursor = "default";
document.getElementById("mainimg").title = caption;
document.getElementById("mainimg").alt = caption;
document.getElementById("imgcaption").innerHTML = caption;
}
return false;
}
_______________
_brian.