Control Galerie with javascript (AJAX).

Author: Digicrafts Last Update: 18/08/2008


You can click and watch the video tutorial.
Video Link Here


Create your own control buttons for Galerie with Javascript

1. Insert the Galerie into your document. Please reference to the Quick Start tutorial for your Galerie. In this sample, the ID of Galerie was set to galerie01.

 

2. In the HTML, insert the following script into the header.

<script language="JavaScript">
//Insert this javascript in your HTML
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
</script>

 

3. Insert the HTML script to the place you want to place the buttons. In this tutorial we make "Previous", "Next", "Play" and "Stop".

More function can be use as following:

<!--When you create the link to control the Galerie, insert the following script you need
Note that the "getFlashMovie" function should input the ID of your Galerie object-->
<a href="#" onclick = "getFlashMovie('galerie01').prevItem();">prev</a> <!--Move to previous item.-->
<a href="#" onclick = "getFlashMovie('galerie01').load('imagesxxx/photos.xml');">load</a> <!--Load xml source.-->
<a href="#" onclick = "getFlashMovie('galerie01').nextItem();">next</a> <!--Move to next item. -->
<a href="#" onclick = "getFlashMovie('galerie01').start();">start</a> <!--Start the menu.-->
<a href="#" onclick = "getFlashMovie('galerie01').stop();">stop</a> <!--Stop the menu.-->
<a href="#" onclick = "getFlashMovie('galerie01').slideshowStart();">slideshowStart</a> <!--Start the slideshow. -->
<a href="#" onclick = "getFlashMovie('galerie01').slideshowStop();">slideshowStop</a> <!--Stop the slideshow.-->

 

4.Press F12 to test the button.