PDA

View Full Version : add Facebox to Image Thumbnail Viewer II script



jonnyd91
09-19-2008, 06:43 AM
1) Script Title: Thumbnail Viewer II script

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamici...thumbnail2.htm

3) Describe problem:

I would like to add the Facebox function to the Thumbnail Viewer II script, so when you click on the larger picture it opens using the Facebox script
http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm

I tried altering the js fole for the thumbnail image viewer II with this line

if (typeof dest!="undefined") //Hyperlink the enlarged image?
imageHTML='<a href="'+dest+'" rel="facebox">'+imageHTML+'</a>'

however it still does not work.

thanks
john

jonnyd91
09-19-2008, 02:39 PM
I was able to fix this by also altering this block of code in the thumbnailviewer2.js file



pagelinks[i]["on"+initType]=function(){ //Load enlarged image based on the specified display type (event)
thumbnailviewer2.loadimage(this) //Load image
//add this from facebox script
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
return false
}