1 (edited by kevin.venables 2015-02-15 12:15:01)

Topic: Mobile Photo Sizing [SOLVED]

I have a gallery running on the home page of a website I am currently developing. I have embedded the gallery in an iframe. The issue I have is that when viewing on my Windows Mobile and the phone is in vertical position the images extend off the screen. Please can you advise best practice etc for what I am trying to achieve.

gundogbreeds.arunset.com

2 (edited by penum 2015-02-15 19:08:42)

Re: Mobile Photo Sizing [SOLVED]

<iframe src="gallery/welcome/index.html" width="450" height="375" frameborder="0" scrolling="no"></iframe>

i think you can do this, put it in an css-container and then

<iframe src="gallery/welcome/index.html" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>

Greetings Peter

Re: Mobile Photo Sizing [SOLVED]

If you have an iframe with fixed dimensions, then the iframe will be displayed at those dimensions in all browsers and on all devices.

You could certainly try using percentage dimensions for your iframe (as penum suggests above) but if the iframe is nested within any parent containers with fixed dimensions, then the iframe's own dimensions will become fixed, e.g. 100% x 800px = 800px.

You might like to take a look at this forum thread, entitled "How to get an IFrame to be responsive in iOS Safari?". Although you have a Windows mobile device, the principles will be the same and it might help with your problem. http://stackoverflow.com/questions/2308 … ios-safari

Another thing you might like to try is to use JavaScript to listen for a change in the user's browser window size and then assign new dimensions to your iframe accordingly.
There are examples of this technique in the Using a Resizable Gallery with a Header support section. In the online examples, JavaScript is used to dynamically set the gallery's dimensions. You could copy and modify the code as required to set your iframe's dimensions instead.

Also, as you have already uploaded your complete gallery folder to your web server, you might like to consider embedding your gallery directly on your page (using the baseUrl method as documented here) rather than using an iframe.
You could replace your iframe code with something like the following:

<!--START JUICEBOX EMBED-->
<script src="/gallery/welcome/jbcore/juicebox.js"></script>
<script>
  new juicebox({
    baseUrl: '/gallery/welcome/',
    containerId : 'juicebox-container',
    galleryWidth : '100%',
    galleryHeight : '600',
    backgroundColor: '#222222'
  });
  </script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->

Just doing this and setting your gallery's width to 100% (so that it fills the width of its parent container), might be enough to solve your problem.

Re: Mobile Photo Sizing [SOLVED]

Hi Steven,

Your embedding gallery directly on page seems the best option however I have another news section on the same page and struggle to page down and see this,  think it is due to automation of photo gallery?

Re: Mobile Photo Sizing [SOLVED]

We recently uploaded a hotfix version of Juicebox (whose 'juicebox.js' file is labelled as v1.4.3.2) which addresses a problem whereby scrolling down a page containing an embedded gallery jumps to the top. This problem was known to happen in Mobile Safari in iOS 8 but please try upgrading your gallery to the latest version to see if it helps on your Windows phone, too.
Full instructions for downloading the latest version and upgrading existing galleries can be found on the Upgrading Juicebox support page.

Please note that if you initiate a scroll gesture on top of the gallery itself, then this may be misinterpreted as the start of a gallery-specific gesture (such as a swipe to navigate between images) so you might need to be quite precise with your gestures.

Re: Mobile Photo Sizing [SOLVED]

Tried the latest release v1.4.3.2 but no difference. As the gallery is only a cosmetic display for the index page decided to hide it in mobile mode. This works fine if I use iframe with the news section scrolling perfectly in mobile mode, however when embedding gallery directly on the page the mobile version prevents news section from scrolling. I am not worried about including the gallery in mobile mode but thought it worth a mention.

Re: Mobile Photo Sizing [SOLVED]

I'm glad it's not a problem that you are too worried about but if there is a bug in Juicebox, we'd still like to know.

I would be very grateful if you could take a little time to check out this sample web page: [Test gallery removed.]
It is essentially a Juicebox-Pro v1.4.3 gallery embedded directly into a web page (rather than using an iframe) using exactly the same configuration options that your gallery does, sandwiched between two large amounts of text (but no other external JavaScript files or other HTML elements).

... think it is due to automation of photo gallery?

I doubt the AutoPlay is the reason for your problem but, just to be sure, here is the same setup as above but with autoPlayOnLoad set to FALSE: [Test gallery removed.]

Are you able to scroll to/through/past the sample galleries on your Windows phone?
Does the page ever jump to the top whilst scrolling?
What exactly is the device that your are using and what browser (and version number) do you use?

Many thanks for your help.

Re: Mobile Photo Sizing [SOLVED]

Steven, I don't know whether this has anything to do with the issues in this thread, but I can't see any buttons at all when I look at those two pages. (You wrote, "The 'Expand' button allows the gallery to fill the browser window and display images at high res.")

Firefox 3.5.0.1, Windows Vista Home Premium

Cheers,

Bill

Re: Mobile Photo Sizing [SOLVED]

@wspollack

That was just text from the original demo pages I used as a template.

The new test pages I created were just to check whether the original poster could scroll past a gallery on his Windows phone which he doesn't seem to be able to do in his own web page.

The text referring to the Expand Button was irrelevant (and perhaps confusing). I have now removed it. Thanks for pointing it out.

Re: Mobile Photo Sizing [SOLVED]

Hi Steven,

My phone is a Nokia 635 running Windows 8.1 and Internet Explorer the gallery you asked me to check loads up but I just get 2 static images in middle of page not scrolling demo as on laptop with Windows 8.1 and Internet Explorer. I should point out that I do use embedded juice galleries in www.midlandenglishsettersociety.co.uk with no issues on mobile. Wonder if the problem is due to multiple grid containers, the template uses the 960 grid system. On the www.midlandenglishsettersociety.co.uk the gallery is embedded straight into the standard width <div class="grid_12"> but is nested on the new gbs site

<div class="grid_12"> </div>
    <div class="grid_6 welcome">
      <div align="center">
        <h6>&nbsp;</h6>
      </div>
      <!--START JUICEBOX EMBED-->
<script src="/gallery/welcome/jbcore/juicebox.js"></script>
<script>
  new juicebox({
    baseUrl: '/gallery/welcome/',
    containerId : 'juicebox-container',
    galleryWidth : '100%',
    galleryHeight : '600',
    backgroundColor: '#222222'
  });
  </script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
           
        <h6>&nbsp;</h6>
    </div>
    <div class="grid_5 news">
      <h5 align="center"><strong>Gundog Breeds Association of Scotland</strong></h5>




I use a modified template from http://www.justdreamweaver.com/dreamwea … lates.html which includes mobile support using CSS3 @media code loaded as below.

<script type="text/javascript" src="js/customscripts.js"></script>

jQuery(document).ready(function($) {
    $("ul.sf-menu").supersubs({
        minWidth: 12, // minimum width of sub-menus in em units
        maxWidth: 27, // maximum width of sub-menus in em units
        extraWidth: 1 // extra width can ensure lines don't sometimes turn over
        // due to slight rounding differences and font-family
    }).superfish().supposition(); // supposition function added to reposition fly-out items when extending beyond browser window

    $("#accordion").accordion({
        autoHeight: false,
        collapsible: true,
        icons: {
            'header': 'ui-icon-plus',
            'headerSelected': 'ui-icon-minus'
        }
    });

    $(function () {
        $("#tabs").tabs();
    });

    // Create the dropdown base for mobile navigation
    $("<div id='mobilenav'><select/></div>").appendTo("#nav");

    // Create default option "Go to..."
    $("<option />", {
        "selected": "selected",
        "value": "",
        "text": "Go to..."
    }).appendTo("#nav select");

    // Populate dropdown with menu items
    $("#nav a").each(function () {
        var el2 = $(this);
        var spancode = el2.html();
        var el = spancode.split('<')[0];
        if ($(this).hasClass("homelink")) {
            $("<option />", {
                "value": "index.html",
                "text": "Home"
            }).appendTo("#nav select");
        }
       
        if (el2.attr("href") != "#" && el != "") {
            $("<option />", {
                "value": el2.attr("href"),
                "text": el
            }).appendTo("#nav select");
        }
    });

    $("#nav select").change(function () {
        window.location = $(this).find("option:selected").val();
    });


});

Re: Mobile Photo Sizing [SOLVED]

My phone is a Nokia 635 running Windows 8.1 and Internet Explorer...

Thank you for the additional information.

... the gallery you asked me to check loads up but I just get 2 static images in middle of page not scrolling demo as on laptop with Windows 8.1 and Internet Explorer.

If I understand correctly, you do not see the images automatically change in the [Test gallery removed.] gallery. Is this correct? They should. The gallery sets autoPlayOnLoad="TRUE" and uses exactly the same configuration options that your own gallery uses. (I copied and pasted the options from your own gallery's XML file.) If you scroll down the page and then scroll on top of the gallery to scroll down further, the gesture may be interpreted as a swipe (to change the image) and this will stop the AutoPlay. This might be what is happening.
Also, does the original problem you posted above ("... I have another news section on the same page and struggle to page down and see this...") happen in the [Test gallery removed.] gallery?

Wonder if the problem is due to multiple grid containers, the template uses the 960 grid system. On the www.midlandenglishsettersociety.co.uk the gallery is embedded straight into the standard width <div class="grid_12"> but is nested on the new gbs site

A nested gallery should cause no problems with either page scrolling (or AutoPlay options).
It is certainly possible, though, that there could be a CSS or JavaScript conflict with some code on your web page.
The only way to isolate a gallery from all other code on your web page would be to load it into an iframe (which you have already done and which seemed to work so this suggests that there may, indeed, be some CSS or JavaScript code on your web page which is adversely affecting the gallery).
You could try removing CSS and JavaScript code from your web page to see if you can find the source of the conflict but it sounds like you have found a suitable workaround that you are happy with and that's absolutely fine.

Re: Mobile Photo Sizing [SOLVED]

Hi Steven,

Have not had time try you suggestions regarding CSS or JavaScript conflict but have found another problem regarding ipad mini, if I use Chrome on ipad have no issues but using standard safari mobile the gallery is positioning across width of screen with  photos in middle of screen

gundogbreeds.arunset.com

<div class="grid_12"> </div>
    <div class="grid_6 welcome">
      <div align="center">
        <h6>&nbsp;</h6>
      </div>
     
     <iframe src="gallery/welcome/index.html" width="100%" height="275" frameborder="0" scrolling="no"></iframe>
     
        <h6>&nbsp;</h6>
    </div>
    <div class="grid_5 news">
      <h5 align="center"><strong>Gundog Breeds Association of Scotland</strong></h5>

Re: Mobile Photo Sizing [SOLVED]

It sounds like you might have a CSS conflict (global CSS rules on your web page that the gallery is inheriting).
However, if this were the case, then I would expect results to be consistent across different browsers.

First of all, please clear the caches of both your browsers to ensure that they are both fetching and using the most recent versions of your web pages from your server.

Differences in the display of web pages in different browsers can often be attributed to HTML errors on the page (some browsers may be more tolerant towards errors than others and might handle them differently).
Try validating the code on your web page with the W3C Markup Validation Service and fix any errors reported. This may help. If not, then at least we can eliminate HTML errors as being a contributing factor to your problem.

Unfortunately, I do not have access to an iPad on which to test so if you continue to experience difficulties, perhaps you could upload screenshots somewhere of what you see in both Chrome and Mobile Safari so that I can at least see the problem for myself.
Many thanks.

Also, it's just a hunch but I've seen problems with percentage-dimension iframes before in Mobile Safari (though usually with height rather than width).
Try changing:

<iframe src="gallery/welcome/index.html" width="100%" height="275" frameborder="0" scrolling="no"></iframe>

... to:

<iframe src="gallery/welcome/index.html" style="width: 100%;" height="275" frameborder="0" scrolling="no"></iframe>

... to see if it helps.
It might not make a difference but it should be quick and easy to try.

Re: Mobile Photo Sizing [SOLVED]

Validated the code on web page with W3C Markup Validation Service and fixed errors still no change when using Safari on ipad have sent you screen shot from ipad separately.

Tried below no difference:

<iframe src="gallery/welcome/index.html" width="100%" height="275" frameborder="0" scrolling="no"></iframe>
... to:
<iframe src="gallery/welcome/index.html" style="width: 100%;" height="275" frameborder="0" scrolling="no"></iframe>

I use a template from http://www.justdreamweaver.com/dreamwea … lates.html called metamorphic the light version can be down loaded free of charge so thought I would just add an embeded version of my gallery into new version of template test.arunset.com this works fine on explorer, chrome & safari & Chrome on ipad but same issue on windows phone where you can not scroll down to gallery.

Re: Mobile Photo Sizing [SOLVED]

Thank you for sending me a screenshot of your problem.

From the look of the screenshot, it certainly looks like Mobile Safari is having a problem with your percentage-width iframe.
What generation of iPad do you have and what version of iOS does it have installed? Perhaps there is a problem with your particular version of Mobile Safari which can be fixed by upgrading your version of iOS.

I suspect that you might have similar sizing issues no matter what content you load into your iframe.
Try loading a different web page (such as http://juicebox.net/) into your iframe to see how your main page looks.
Does the size of the iframe look OK in Mobile Safari with content other that the gallery loaded into it?

Your iframe has a width of 100% but the browser will need to know what its actual width should be 100% of, so please make sure that all parent containers of your iframe have widths defined using CSS. Also, try including the dimensions of your iframe's parent containers as inline CSS (similar to the note for Using Percentage Heights but with widths instead).

This forum thread regarding "How to get an IFrame to be responsive in iOS Safari?" might also be of interest: http://stackoverflow.com/questions/2308 … ios-safari

However, I would still recommend embedding your gallery directly in your web page (rather than using an iframe).
Maybe you could try this again.

With regard to the scrolling issue, if you can scroll past the gallery in my test page ([Test gallery removed.]), then the problem may lie somewhere within the code on your web page.
If you load the gallery into an iframe, then try embedding the gallery directly into your web page to see if the scrolling problem still occurs. (There may be some kind of problem scrolling past iframes on a Windows phone.)
If you already embed the gallery directly in your web page, then try removing all external CSS and JavaScript files from your page, one at a time, and check the functionality after removing each one until you find the source of the conflict.

I hope these notes help.

Re: Mobile Photo Sizing [SOLVED]

I believe the issues I am having revolve around my windows 8.1 mobile phone with safari. I tried my wife's iPhone with safari and the embedded version works fine. Regarding the scrolling with your gallery this does not work properly either, it loads but the gallery only shows one photo Fixed.

Re: Mobile Photo Sizing [SOLVED]

Sorry my windows phone uses explorer 11 not safari. Getting confused with iPad/phone

Re: Mobile Photo Sizing [SOLVED]

There seems to be a few different issues going on here and I think we might be at cross purposes with at least one of them.

When you originally said "I have another news section on the same page and struggle to page down and see this", I thought the problem was that you could not scroll down past the gallery to see what was below the gallery on the page.
This is why I created the test page [Test gallery removed.] - to see if you could scroll down the page past the gallery to see the text below the gallery. The fact that the gallery had an automated slideshow was just incidental (I used it because you used it in your own gallery and wondered if it could be the cause of the problem: "think it is due to automation of photo gallery?"). We seem to have been sidetracked into a problem with AutoPlay (the automated changing of images within a gallery) rather than the original 'scrolling down a page' issue.

As I noted earlier, maybe the AutoPlay is stopping when you scroll down the page and touch the gallery. (If you tap on the gallery to scroll down the page, Juicebox might see this as the start of a swipe gesture to change the image and the AutoPlay will stop.)

It might be a good idea to take a step backwards just now and clarify a few things.
Using my test page: [Test gallery removed.]
(1) On your iPad, can you scroll down past the gallery to see the text below the gallery?
(2) On your Windows phone, can you scroll down past the gallery?
(3) On your iPad, does the AutoPlay work (do images change automatically)?
(4) On your Windows phone, does the AutoPlay work?

For (3) and (4) above you could try this test gallery instead: [Test gallery removed.]
Same gallery, just no text on the page so no need to scroll down the page and perhaps accidentally stop the AutoPlay.

Also, have you tried loading any other content into your iframe yet to see if your other layout problem is a general iframe problem or directly related to Juicebox?

I'm hopeful that we can narrow the problems down and figure out exactly what's going on.

Re: Mobile Photo Sizing [SOLVED]

Hi Steven,

It might be a good idea to take a step backwards just now and clarify a few things.
Using my test page: [Test gallery removed.]
(1) On your iPad, can you scroll down past the gallery to see the text below the gallery?
No issues with ipad Mini
(2) On your Windows phone, can you scroll down past the gallery?
Windows Phones use Explorer 11 Mobile and this is where the problems start, when loading above you just get the first part of text and the screen is frozen you are not able to view any part of gallery. A reading icon pops up in explorer which when pressed compresses text into a mobile view and you can scroll down to gallery however all you can see are two fixed images with no option either auto or manual to view other photos. See reading view section on below link.

http://blogs.msdn.com/b/ie/archive/2014 … phone.aspx

(3) On your iPad, does the AutoPlay work (do images change automatically)?
No issues with ipad Mini
(4) On your Windows phone, does the AutoPlay work?
See answer to option 2
For (3) and (4) above you could try this test gallery instead: [Test gallery removed.]
Works fine on both ipad & Windows phone in full screen mode.
Same gallery, just no text on the page so no need to scroll down the page and perhaps accidentally stop the AutoPlay.

Re: Mobile Photo Sizing [SOLVED]

Many thanks for the additional information.
It certainly looks like Reading View in IE11 is the source of the problem.

Try adding the following line of code to your web page's <head> section. Once implemented, the Reading View icon should not appear in the address bar.

<meta name="IE_RM_OFF" content="true">

This code was taken from the Reading View Guidlines support page: http://ie.microsoft.com/testdrive/browser/readingview/
(Click the '</> Code' tab and scroll down to the 'Opt Out' section at the bottom.)

Hopefully this will help.

Re: Mobile Photo Sizing [SOLVED]

HI Steven,

Finally cracked it, the Reading View icon code has worked. I have now applied the embedded version gallery and it works fine on Windows Phone.

<meta name="IE_RM_OFF" content="true">

Re: Mobile Photo Sizing [SOLVED]

I'm glad to hear that it worked.
Many thanks for letting me know.

Re: Mobile Photo Sizing [SOLVED]

Hi Steven

Thought removing the reading view icon in exporter. V11 for windows phone had solved problem but although the gallery works cannot scroll below to next section on webpage. This is not the case on iPhone which behaves perfectly.

Re: Mobile Photo Sizing [SOLVED]

OK. Thank you for letting me know.
I have notified the developers who will investigate further.
I will post back in this thread when I have any further news.

Re: Mobile Photo Sizing [SOLVED]

Please try the following.

Open the 'jbcore/classic/theme.css' file in a plain text editor and change lines 945-947 from:

body, html {
    -ms-touch-action: none;
}

... to:

.juicebox-gallery {
    -ms-touch-action: none;
}

Hopefully this will fix the problem.

Please note that the line numbers above refer to the current version of Juicebox-Pro (v1.4.3.2).