OK, here goes. Add this line (red) to loadimage:function(linkobj):
Code:
loadimage:function(linkobj){
var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
thumbnailviewer2[linkobj.getAttribute("rev").split("::")[0]]=parseInt(linkobj.getAttribute("id").split("_")[1]);
var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any
var description=(thumb . . .
Add this function (red) to the script:
Code:
addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},
get:function(r,d){
var re=new RegExp(r+'_');
for (var i = 0, a=document.links, ta=[]; i < a.length; i++)
if(a[i].id&&!isNaN(parseInt(a[i].id.replace(re, ''))))
ta[a[i].id.replace(re, '')]=a[i];
if(!ta.length)
return;
var idx=typeof thumbnailviewer2[r]=='number'? thumbnailviewer2[r] : 0;
if(typeof thumbnailviewer2[r]=='number'||d==-1)
idx+=d;
idx=idx>=ta.length? 0 : idx < 0? ta.length-1 : idx;
thumbnailviewer2.loadimage(ta[idx]);
},
init:function(){ //Initialize thumbnail viewer script
this.iefiltercapable=(this.iefiltercapable && this.enableTransition) //True or false: IE filters supported and is enabled by user
var pagelinks=docume
Now where you would have had (from the demo):
Code:
<a href="bulb.gif" rel="enlargeimage::click" rev="loadarea">Thumbnail</a>
Add an id the prefix of which is the rev attribute + an underscore and a number from 0 to whatever that represents this image's order for the previous/next buttons:
Code:
<a id="loadarea_0" href="bulb.gif" rel="enlargeimage::click" rev="loadarea">Thumbnail</a>
Now you can (if there are more than one image in this group) have buttons (or links, whatever) like so:
Code:
<input type="button" value="-" onclick="thumbnailviewer2.get('loadarea', -1)">
<input type="button" value="+" onclick="thumbnailviewer2.get('loadarea', 1)">
Bookmarks