First download the JavaScript package: http://thecodecentral.com/wp-content/uploads/2007/08/yuilightboxwdep.zip / /Modify the following path according to the downloaded JavaScript package ... <br><br>//Load lightbox <br>init = function()...{ <br>//Create a data source, including the original image<br>//Usage: Image ID: {url: "Original image path", title:"title" } <br>var dataSource = ...{ <br>id_1:...{url:"image-big.jpg", title: ' Test image'} <br>}; <br><br>//Create Lightbox object: <br>//Usage: <br>//imageBase: path to Lightbox.js<br>//dataSource: data source<br>var lightbox = new YAHOO.com.thecodecentral.Lightbox(...{ <br>imageBase:'js/lightbox', <br>dataSource: dataSource <br>}); <br>} <br>// Keep this line as it is <br>YAHOO.util.Event.on(window, 'load', init); <br> //Add a preview image//Usage: //Note: Keep the picture ID and data source ID consistent Code without annotations: < ;html> <br><br>init = function(){ <br>var dataSource = { <br>id_1:{url:"image-big.jpg", title: 'Test Image'} <br> }; <br><br>var lightbox = new YAHOO.com.thecodecentral.Lightbox({ <br>imageBase:'js/lightbox', <br>dataSource: dataSource <br>}); <br>} <br><br>YAHOO.util.Event.on(window, 'load', init); <br>