(5 replies, posted in SimpleViewer-Pro v2)

Hi, i just read your answer, thank you! It's really good think that you are listening to users and answer. If I would like to buy another gallery/web design engine, I will go to simpleviewer.net for sure.

For now I solved my problem, but it's hack :-)

So lets play the game:

1) I decompressed simpleviewer.js
2) I realized, You have a function which differs "smallandroid" than big (small is defined as:

Math.max(screen.width, screen.height) < 800

hmm, I think this isn't good because in this times my tablet have 1280 long edge and phone also, but the trick is the density, effective resolution for phone is 640.

3) In big android You don't hide the address bar.
4) In small You hide it, and also show a crop instead a full photo.

5) So I decided, for me better solution is to hide addressbar everytime in android, and changed the function:

6) ...but i was not finish, in small android you return screen.height from the function adjustHeight4Devices, and it is not correct in this times because of density, so I changed this function (It's my own hack):

                var c = getAndroidVer();
                if (c >= 4) {
                    if (screen.width > $(window).width()) {
                        var e = screen.width / $(window).width()
                        return screen.height / e
                    } else {
                        return screen.height

instead of

            if (isSmallAndroid()) {
                var c = getAndroidVer();
                if (c >= 4) {
                    return screen.height * 1.25

I know it is not ideal solution, If I have some time in the future, I'll think about better  :)


(5 replies, posted in SimpleViewer-Pro v2)

I read a little about address bar in android.

The problem is, android native browser reports innerheight with address bar shown, so when simpleviewer is fired up with 100% height it is to small to scroll in order to hide this bar.

I tried to put in simpleviewer.load function window.innerheight+32px as height and it works, but... you cant rotate the screen after first image is displayed, because after screen rotation sv still is old height :-( and also new button "fullscreen" appears.

We can catch onrotate event to set new height, but smpleviewer.js is coded so i don't know if it is a function for set new height.

Is there that function?

or I have to wait for an upgrade?


(5 replies, posted in SimpleViewer-Pro v2)

It's good to hear, address bar is hidden, I haven't got an i(pod|pad|phone) to test.

I'm using android and the address bar isn't hidden.

Hmm.. I will take a look at juicebox, but you know... I'm already spent ~$45 and think is enough for gallery engine.


(5 replies, posted in SimpleViewer-Pro v2)

Hi there,

This is my last question, I hope :-)

Is the possible to run sv mobile version on fullscreen?
My sv is configured not to show thumbnails only photos, and always show address bar in gallery view, which is annoying because it is mobile so the screen is small. Other sites hide the address bar.

Here is link m.pawelkordys.pl/SriLanka

Thanks, Now I understand, I didn't know about same-origin policy.

Probably I'll move galleries to my /m folder, so my top domain can read from /m folder because it subfolder of public_html, and sub-domain will can read galleries also. Thanks.

I tried also:

    <script type='text/javascript' src='http://domain.com/svcore/js/simpleviewer.js'></script>
    <script type='text/javascript'>
    simpleviewer.ready(function () {
        simpleviewer.load('sv-container', '100%', '100%', '222222', false, {galleryURL: 'http://domain.com/photos/gallery name/gallery.xml'});
    <div id='sv-container'></div>

still no success :-(

Hello again,

Now it's time to run my galeries on mobile :-)

I have another problem, my photos are in domain.com/photos/gallery_name/
svcore is domain.com/svcore

and mobile version of site is m.domain.com

at m.domain.com I have folders:


inside each is index.html

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
    <meta http-equiv='content-type' content='text/html; charset=utf-8'>

    <script type='text/javascript' src='http://domain.com/svcore/js/simpleviewer.js'></script>
    <script type='text/javascript'>
    var flashvars = {};
    flashvars.baseURL = 'http://domain.com/photos/gallery_name/';
    simpleviewer.ready(function () {
        simpleviewer.load('sv-container', '100%', '100%', '222222', true, flashvars);
    <div id='sv-container'></div>

and this code works great from desktop browser, but from mobile device (where flash isn't installed) I have "gallery xml not found' error, probably non-flash version don't use flashvars.baseURL?

Any fix?


(1 replies, posted in SimpleViewer-Pro v2)

Just for explanation for new users:

Documentation, You can found here: http://www.simpleviewer.net/simpleviewe … l#tracking is slightly outdated, because it shows old synchronous google snippet which break loading the page until google servers answers.

Since December 2009 google recomend async snippet which is better and diffrent that previous one. Below most important parts (even if You aren't web dev, it will be easy to change the code from example:

<script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);  // PUT YOUR ID HERE

        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
function svImageChange(imgIndex) {
    var hrefArray = window.location.pathname.split( '/' );
    try {
        _gaq.push(['_trackEvent', 'SimpleViewer', 'Image_View', hrefArray[1]+'/'+imgIndex+1]);
    } catch (err) {}

Hope this helps.

I'll try. Thank you for Your support.

Thanks for your explanation, I used your code combined with my own, and now everything works correctly, my own part is in php, because I have few galleries, so javascript never know number of photos in desired gallery.

javascript part as you wrote:

*index  - extracted from url via javascript
*number - from php code (below)

flashvars.firstImageIndex = Math.max(0, Math.min(index, number));

and finally my php code:


$path = parse_url($url, PHP_URL_PATH);

$explodedpath = explode("/", $path);

$xml = simplexml_load_file("http://xxx.xxx/photos/$explodedpath[1]/gallery.xml");

$number = count($xml->image);

echo "\t<script type='text/javascript'>var number = $number</script>\n\n";

Of course this is simplified version, I also have part which checking the url in order to prevent load gallery.xml file from non existant locations.

P.S. I'm using global javascript variable for transfer value from php to javascript, I don't like to use global variables, but it is best I can do (AFAIK)

Oh no....

I'll try to explain it better.

I set up direct linking i.e.

if I point my browser to http://xxx/photos/exmaple#1

simpleviewer starts and show 1st image in ths galley - this is correct

if I point my browser to http://xxx/photos/exmaple#2

simpleviewer starts and show 2nd image in ths galley - this is correct


if I point my browser to http://xxx/photos/exmaple#21

simpleviewer don't start because in example gallery I have 20 images
and firstImageIndex is set to 21

I would like in this situation simpleviewer start and show first image,
You never know what user put in address bar :-)


I have problem I coding direct linking to my images (without back-forward browser buttons)

Here is code:

flashvars.firstImageIndex = index;
flashvars.baseURL = "http://xxx/photos"+href+"/";
simpleviewer.ready(function () {
     simpleviewer.load('sv-container', '100%', height+"px", "transparent", true, flashvars);

index is a variable grabbed from url. I have 20 images in gallery, when the index becomes 21 gallery isn't load. How to correct it and load gallery with flashvars.firstImageIndex = 0