Topic: javascript in gallery.xml

Hi,

I am no expert at this stuff and my idea may be totally off the mark, but I'll ask anyway.


I would like to use the following script for pictures displayed in simleviewer:
---------------------------------------------------------------
<script type="text/javascript">

if (document.images)
{
    image1 = new Image;
    image2 = new Image;
    image1.src = "images/picture1.jpg";
    image2.src = "images/picture2.jpg";
}

function chgImg(name, image)
{
    if (document.images)
    {
        document[name].src = eval(image+".src");
    }
}

</script>
---------------------------------------------------------------

code:
---------------------------------------------------------------
<img src="images/picture1.jpg" width="402" height="600" alt="" title="" border="0" align="middle" name="pic1" onmouseover='chgImg("pic1", "image2")' onmouseout='chgImg("pic1", "image1")'>
---------------------------------------------------------------


Can that script be used in the gallery.xml like inside the following:
---------------------------------------------------------------
<simpleviewergallery

    title="Pictures"
    frameWidth="0"
whatever, whatever...
    embedHeight="84%"
    stageVAlign="TOP"

>
  <image imageURL="images/picture1.jpg"
    thumbURL="thumbs/picture1.jpg"
    linkURL=""
    linkTarget="">
    <caption>Picture 1</caption>
  </image>
</simpleviewergallery>
---------------------------------------------------------------

Thanks

Re: javascript in gallery.xml

You can not use JavaScript inside the gallery.xml, you can however use a server side script such as php to create a dynamic XML. If you look through the forums you can find examples of this being done.

Mike Richards
SimpleViewer Support Team.

Re: javascript in gallery.xml

Mike Richards wrote:

You can not use JavaScript inside the gallery.xml, you can however use a server side script such as php to create a dynamic XML. If you look through the forums you can find examples of this being done.

Thanks Mike, but Iā€™m afraid php and server side scripts are way beyond my knowledge base. Guess I'll have to live without that effect.