Topic: Nav buttons in fixed position ?

Hello guys,


I am using a simpleviewer pro gallery with horizontal and vertical images.
The problem is that depending on image orientation, the nav button (prev/next arrow) appear at different places since they are positionned related to the image edges.

Is there any way to make them appear always at the same position, no matter the image size/proportion/orientation ?

Thanks !

Re: Nav buttons in fixed position ?

Not directly, but you could disable the gallery's own image navigation arrows (by setting showImageNav="NEVER" in your gallery's XML file), create your own image navigation buttons (using text, HTML or images), position them anywhere on your web page (using CSS) and have them act the same as the gallery's own image navigation arrows by using the SimpleViewer-Pro API showPreviousImage() and showNextImage() methods.
There is an online demonstration here which has 'Show Next Image' and 'Show Previous Image' buttons in action.

Steven Speirs
SimpleViewer Support Team.

Re: Nav buttons in fixed position ?

thank you ! this is just what I needed ! I'll implement this right away !

Have a good day,

Ben

Re: Nav buttons in fixed position ?

Just another thing : I noticed in your example link that the gallery is embedded using javascript.
In my case, the gallery is just integrated using an iframe.

Would it be possible to have the previous and next controls on the main page and still use an iframe using the API to control it ?
Or should the controls also be in the iframe source (gallery html file) ?
In the first case, how good would that work on various browsers ? (transfering commands to the child iframe)?

Thank you

Re: Nav buttons in fixed position ?

Would it be possible to have the previous and next controls on the main page and still use an iframe using the API to control it ?

Yes.
You could set up an API function named showNextImage() on the page which you are loading into your iframe (the page into which the gallery is embedded), give your iframe a unique id and call the function from a button on the parent page using code such as:

<input name="next" type="button" value="Show Next Image" onclick="document.getElementById('gallery').contentWindow.showNextImage()" />
<iframe id="gallery" src="index.html" width="800" height="600" frameborder="0" scrolling="no"></iframe>

This should work fine across all major browsers.

Steven Speirs
SimpleViewer Support Team.

Re: Nav buttons in fixed position ?

Hello,

I would like to open this post again to check potential problems with the mobile version (no flash).

My script for the flash version uses the API methods 'svComplete' and 'svImageChange' and it works fine. I put some code in the svComplete code to retrieve the total number of pictures in the gallery (using svAPI.getGalleryInfo).

I ran into some problem using the mobile version (non flash). I have seen that another method is to used, which is 'svMobileComplete' and it fires well when the player loads. But I can't manage to use the same code to retrieve the number of images in the gallery.
Could you let me know if the getGalleryInfo method is working on mobile galleries ?


The code is the following, and I get no output (alert message), so I think it gets stuck somewhere...

function svMobileComplete() {
var svAPI = document.getElementById('svInstance');
var info = svAPI.getGalleryInfo();
var imageTotal = info.imageCount;
alert("Images in gallery: "+imageTotal);
}

Re: Nav buttons in fixed position ?

Try the following:

var svAPI;

function svComplete() {
    svAPI = document.getElementById('svInstance');
};

function svMobileComplete() {
    var info = svAPI.getGalleryInfo();
    var imageTotal = info.imageCount;
    alert("Images in gallery: " + imageTotal);
};
Steven Speirs
SimpleViewer Support Team.

Re: Nav buttons in fixed position ?

Thank you ! this works !

As I always want to know how things works, can you explain why this is like this ? Was was wrong with trying to get the instance by name as I did first ?

Re: Nav buttons in fixed position ?

I do not know the technical details behind this but it looks like the svAPI variable must be defined in the svComplete function for both Flash and Mobile galleries as in the SimpleViewer-Pro online demo here. (View the source of the web page in your browser to see the code used.)

Steven Speirs
SimpleViewer Support Team.