Download a new SpryImageLoader:
http://www.spry-it.com/builds/SpryImageLoader.js
example htmlish...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("xml/deutsch/index.xml",
"imageset/image"),
loader = new Spry.Utils.ImageLoader(function(){
loaded = true;
var rgn = Spry.Data.getRegion('thumbwrapperindex');
if(rgn)
rgn.setState('ready');
}),
loaded = false;
ds1.loadData();
ds1.addObserver({
onPostLoad:function(ds,data){
var dataset = ds.getData();
for(var i = 0, length = dataset.length; i < length; i ++
){
loader.load(dataset
[ "galerieset/index/images/thumb/" ]);
}
}
});
var pv1 = new Spry.Data.PagedView( ds1,{pageSize:50});
var pvInfo = pv1.getPagingInfo();
Spry.Data.Region.addObserver("thumbwrapperindex", {
onPostUpdate: function() {
if(!loaded){
var rgn = Spry.Data.getRegion('thumbwrapperindex');
if(rgn)
rgn.setState('loadingThumbs');
} else {
Lightbox.init({descriptions: '.lightboxDesc'});
}
}
});
//-->
</script>
</head>
<body>
<div spry:region="pv1" id="thumbwrapperindex">
<div spry:state="loadingThumbs">
Loading thumbs please wait.. message
</div>
<div spry:state="ready">
Stuff that needs to be shown after the images are loaded..
</div>
</div>
</body>
</html>
Example code, notice the spry:states in the spry:region
I didn't test it because I don't have access to any on this
laptop -_-"
*crosses fingers*
What it should do:
when the xml has been loaded, we loop through the data, and
load the image locations in the Spry Image Loader. I have modified
the Spry Image loader that it allows a callback when all images
have been loaded. We will use this new callback to set states of
your region.
You can now have a separate state in your region that shows a
loading message. And the ready state will show when the data has
been loaded.
EDIT TO GET THE FULL CODE, QUOTE MY POST, AND COPY THE CODE FROM
THE REPLY BECAUSE THE FORUM SEES MY CODE AS A ITALIC STYLE CODE..
oh ignore the caps, didnt notice it was on and im currently not in
the mood to retype it all again ;)