First download the JavaScript package:
Http://thecodecentral.com/wp-content/uploads/2007/08/yuilightboxwdep.zip
Modify the following path based on the downloaded JavaScript package
<link rel= "stylesheet" type= "Text/css" href= "Js/yui/assets/skins/sam/container.css"/>
<script type= "Text/javascript" src= "Js/yui/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type= "Text/javascript" src= "Js/yui/dragdrop/dragdrop-min.js" ></script>
<script type= "Text/javascript" src= "Js/yui/container/container-min.js" ></script>
<script type= "Text/javascript" src= "Js/lightbox/lightbox.js" ></script>
<script type= "Text/javascript" ....
Load Lightbox
init = function () ... {
Make a data source containing the original picture
Usage: Picture ID: {URL: "Original picture Path", Title: "Title"}
var DataSource = ... {
Id_1: ... {URL: "image-big.jpg", Title: ' Test Picture '}
};
To create a Lightbox object:
Usage:
Path to ImageBase:Lightbox.js
DataSource: Data source
var lightbox = new YAHOO.com.thecodecentral.Lightbox (..... {
ImageBase: ' Js/lightbox ',
Datasource:datasource
});
}
This line keeps the original.
YAHOO.util.Event.on (window, ' Load ', init);
</script>
<body>
Add a preview picture
Usage:
Note: Keep the picture ID and data source ID consistent
</body>
No annotation for code:
<link rel= "stylesheet" type= "Text/css" href= "Js/yui/assets/skins/sam/container.css"/>
<script type= "Text/javascript" src= "Js/yui/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type= "Text/javascript" src= "Js/yui/dragdrop/dragdrop-min.js" ></script>
<script type= "Text/javascript" src= "Js/yui/container/container-min.js" ></script>
<script type= "Text/javascript" src= "Js/lightbox/lightbox.js" ></script>
<script type= "Text/javascript" >
init = function () {
var DataSource = {
Id_1:{url: "Image-big.jpg", Title: ' Test Picture '}
};
var lightbox = new YAHOO.com.thecodecentral.Lightbox ({
ImageBase: ' Js/lightbox ',
Datasource:datasource
});
}
YAHOO.util.Event.on (window, ' Load ', init);
</script>
<body>
</body>