Viewing 1 replies (of 1 total)
  • I just started using WordPress, so I don’t know how it was, but here is the fix:

    In the lightbox.js file, add firstChild as shown below:

    if((imageLink.getAttribute('rel') == 'lightbox')){
    			// add single image to imageArray
    			imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.firstChild.getAttribute('title')));	 // Added firstChild
    		} else {
    		// if image is part of a set..
    
    			// loop through anchors, find other images in set, and add them to imageArray
    			for (var i=0; i<anchors.length; i++){
    				var anchor = anchors[i];
    				if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){
    					imageArray.push(new Array(anchor.getAttribute('href'), anchor.firstChild.getAttribute('title'))); // Added firstChild
    				}
    			}
    			imageArray.removeDuplicates();
    			while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;}
    		}

    Also, if you want the image’s caption instead of the title, change both the ‘title’s to ‘alt’s in the same changed lines.

Viewing 1 replies (of 1 total)
  • The topic ‘Caption not Showing’ is closed to new replies.