PDA

View Full Version : thumbnail viewer II: reset?



radiofriendlybox
02-27-2008, 07:03 PM
1) Script Title: thumbnail viewer II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem: how can i add a function to the script that will clear the enlarged image in the loadarea (using onclick)? i don't want the page to reload or have a blank image loaded into the loadarea. i would just like the current image in the loadarea to be removed. i hope this makes sense. thanks!

jscheuer1
02-27-2008, 07:16 PM
onclick of what? Do you mean that you want to click on the larger image and have it disappear? What action on the part of the user do you want to have make the larger image disappear? If you just mean onmouseout of a clicked trigger, you could add this to every clickable thumbnail:


<a href="bulb.gif" rel="enlargeimage::click" rev="loadarea"
onmouseout="document.getElementById('loadarea').innerHTML='';">Thumbnail</a>

radiofriendlybox
02-27-2008, 07:34 PM
onclick of what? Do you mean that you want to click on the larger image and have it disappear? What action on the part of the user do you want to have make the larger image disappear? If you just mean onmouseout of a clicked trigger, you could add this to every clickable thumbnail:


<a href="bulb.gif" rel="enlargeimage::click" rev="loadarea"
onmouseout="document.getElementById('loadarea').innerHTML='';">Thumbnail</a>

let's say i have four links:

pic1
pic2
pic3
clearpic

pics1-3 will load an enlarged pic in the loadarea.
clearpic will remove the pic from the loadarea.

thanks.

radiofriendlybox
02-27-2008, 07:47 PM
oh. i just used your code, but changed to "onclick" function. thanks!

jscheuer1
02-27-2008, 09:50 PM
Practically speaking due to the behavior of some browsers (and sometimes, even some hosts), if it really is a link, it should return false and have descriptive (but ultimately unused) javascript href:


<a href="javascript:clearPic();"
onclick="document.getElementById('loadarea').innerHTML='';return false;">clearpic</a>