Topic: Use javascript behaviour to select the image displayed

I am new to Simple Viewer. My question may have been answered already but I haven't been able to find a releveant posting.

I want to use a javascript behaviour [onClick] to display a particular image in my gallery.
I realise this can be done using the fo.addVariable("firstImageIndex", "1")
function.

For example, the following function can be called to force a re-load of the viewer at a particular image

        function  change_pic(pid){
        fo.addVariable("firstImageIndex", pid);   
        fo.write("flashcontent");   
        }

Is it possible to use some similar function to force SimpleViewer to move to the designated image WITHOUT reloading the gallery? If so can anybody provide sample code that would use an OnClick behaviour in some page text to cause Simple Viewer to change the image displayed.

Thanks in advance,

John

Re: Use javascript behaviour to select the image displayed

Hi,

selecting images via javascript is not currently supported.

Felix Turner
SimpleViewer Support Team.

Re: Use javascript behaviour to select the image displayed

Best move my post to the 'wish list' forum then sad

Can you suggest a route I might explore to add such functionality? Could it for example, be implemented by adding an 'id' field accessible via the gallery.xml file?
What actually happens and where when a thumbnail is clicked or the mousewheel rolled?
I take it that the php function you mention would also force a reload/refresh of the entire gallery if called more than once

FYI I have written a short JS function which rewrites the gallery.xml path when a linked object or text is clicked and thus allows multiple galleries to be access through a single html page. My applications are for holiday home descriptions and a photographer's gallery.  After drowsing this forum it seems something that might be useful to quite a few people.
I'll post a link when they are functioning properly.

Edit for 'drowsing' read 'browsing'. Though at times it did make me drowsy

John wink

Re: Use javascript behaviour to select the image displayed

FYI I have written a short JS function which rewrites the gallery.xml path when a linked object or text is clicked and thus allows multiple galleries to be access through a single html page.

I'm trying to do this type of thing as well.  I'm just barely starting to learn Javascript.  Could you post the code you came up with to do it? 

As it is now, I have about 10 different gallery.htm files (each with a different name) that are identical except for this one line, where I specify the name of the xml file:
fo.addVariable("xmlDataPath", "galleryHaunt2008.xml");
The next file is:
fo.addVariable("xmlDataPath", "galleryHaunt2007.xml");
The next file is:
fo.addVariable("xmlDataPath", "galleryHaunt2006.xml");
and so on.... that's the only line that is different.

I want to narrow it down so I have just one gallery.htm file, by changing the name of the .xml path relative to the link that is clicked from my gallery page.

But that's only half that battle because then I'd still have 10 or more xml files that I'd also like to narrow down to just one.  What if I could merge them all into one xml file (instead of 10) and give each section an xml tag that determines which grouping of pictures are loaded?  Like you said, maybe an ID field?

Re: Use javascript behaviour to select the image displayed

Take a look at this post it uses javascript to control the flash. You should be able the addon to it.

http://www.airtightinteractive.com/foru … php?t=8314

Mike Richards
SimpleViewer Support Team.