Initialize on Page Load
The most common way to load a gallery is on page load by using the init() method of the component:
galleryxml.init('MyGear/Alexi.xml')
Load on Demand
Gallery.XML comes with a method for loading galleries on demand without reloading the current page. This can be achieved by using the demand() method of the component:
galleryxml.demand('gallery-xml/MyGear/Aurellia.xml');
Press the button below to load a gallery on demand.
Assigning Custom Function on Thumbnail Click
The XML feed file of Gallery.XML has a special property called onclientclick which allows to assign custom function upon thumbnail click. It works independently from the enableenlarge property. If left blank (onclientclick="") a click on the thumbnail will only show the fullsize image (if enableenlarge="true").
Here is an example of how to use the onclientclick property, and you may test this functionality in the gallery below:
<ajaxgallery>
<item onclientclick="alert('Image SRC: ' + this.getElementsByTagName('IMG')[0].src)" />
<item onclientclick="alert('Image SRC: ' + this.getElementsByTagName('IMG')[0].src)" />
</ajaxgallery>
Reuse Gallery Placeholder
The demand() method of the component may be used to load different galleries in a single placeholder. One possible use is shown below:
function changeinstrument(combo)
{
if(combo.selectedIndex != 0)
{
galleryxml.demand('gallery-xml/MyGear/' + combo.value + '.xml');
}
}
Select galleries from the combo below to load them withour refreshing the page in the same placeholder:
Browser Support
Gallery.XML has been tested on standards-compliant web-pages and it works with all major browsers. Quirks mode is not supported.
- Internet Explorer 6
- Internet Explorer 7
- Internet Explorer 8
- Mozilla FireFox
- Opera
- Google Chrome
- Apple afari
Differences Between the Lite and Full Version
The Lite version comes with a set of three skins only, while the Full version is delivered with a full set of 12 skins. Also, the Lite version displays a trial message at the bottom of each gallery, and "UNREGISTERED" text over the enlarged image. If you with to remove these limitations, you may purchase the full version via PayPal for USD20 by clicking the Purchase Full Version link on the demo page you have downloaded.