stickyAutoFit and differently sized images

Page: 1

Author Post
Member
Registered: Aug 2012
Posts: 26
Hello,

it looked like stickyAutoFit met exactly our requirement. However, if the images in a gallery are of different size floatbox doesn't always zoom fully in if the previous image was zoomed in. You can see this behavior f.e. on this page (click on image).

We currently still use 6.0.4, since centerOnResize is vital for us. (Think of all the mobile devices switching from portrait to landscape easily...)

Many thanks for this great software!

best regards
Erik
Administrator
Registered: Aug 2008
Posts: 3382
Bonus points for including a link to an example page. Penalty points for not using Floatbox on that page. Clicking the images opens a new image display page in a new tab.

I think what you are telling me is that inFrameResize is set to false, autoFit is left unset or is set to true, stickyAutoFit is set to true, and when you resize an image up to full size from an autoFit reduction and then navigate to the next image, the next image is not shown full size.

If the above is accurate, I can't reproduce the issue. stickyAutoFit works as expected for me.


You may be pleased to know that the soon-to-be-released version 7 includes redrawing of the floatbox on browser resize and orientation change. This will not be a settable option; it's just what it always does.
Member
Registered: Aug 2012
Posts: 26
Hmmm.... I tested yesterday before I posted with Firefox and today with Firefox, Chrome and IE and it worked on all of them. Floatbox is used on that page, but apparently didn't load or work, in which case there is a fallback.

Yes, the options are set as you described. Here is the complete block from options.js:
naked: {
boxRoundCorners: "none",
showOuterClose: false,
showClose: true,
controlsPos: "tr",
controlsType: 'international',
controlsOpacity: 0.4,
inFrameResize: false,
stickyAutoFit: true,
resizeTool: 'both',
showItemNumber: true,
imageTransition: "slide",
navType: "overlay",
doAnimations:true,
mobileDoAnimations:true,
mobileNewWindow:true,
autoFitSpace:1,
caption: null,
caption2: null,
outerBorder: 0,
innerBorder: 0,
padding: 0,
panelPadding: 0,
shadowSize: 0,
zoomBorder: 0
}


Indeed, if I navigate to the next image, the next image is not shown full size but not fitted to the screen either.
Administrator
Registered: Aug 2008
Posts: 3382
I dove into the page code to see why it was using Floatbox for you and not for me.

Clicking the images does not invoke the standard Floatbox click handler, but rather calls a custom function 'fbGallery'. This function decides whether to start a floatbox or display a new tab based on the value of Modernizr.touch. Modernizr.touch does not indicate if the user is using touch, but rather if the browser has touch aware event handlers available. My test platform is touch capable, but I'm running standard desktop browsers and using fullsize keyboard, mouse and large screen. Your function detects the touch capability and denies me use of Floatbox because of its presence.

This is clearly undesired behaviour and probably a bad strategy. Not sure why you want to block Floatbox from touch users anyway. Floatbox is fairly touch friendly and works as well with the touch interface as it does with a mouse.


The stickyAutoFit behaviour you describe is the case with the version 6.0.4 release you are using. Version 6.1.0 behaves differently in that it will succeed in showing the subsequent images at their full native size. There's nothing I can do to change those facts.


Just as an editorial comment, and not to start a debate, but I don't see the virtue in overriding the default behaviour of always fitting images to the visible screen when first shown. I really don't know why it would be preferable to show just the top-left portion of the image and probably push captions and controls off the screen too. And I also think the default in-frame resizing is superior to inFrameResize:false in that it's easier to move around to different areas of the enlarged image, and the controls and caption stuff remains visible all the time.
Member
Registered: Aug 2012
Posts: 26
Many thanks for your effort, sorry, I should have remembered it is disabled on touch.

I'd prefer in-frame zoom as well, if the frame would extend to the visible screen. Frame is very small for portrait images on landscape screens. Is this possible?

Not using floatbox for touch devices was probably because looking around the zoomed image and swiping to next image didn't go together very well or because there was no indication to zoom on touch devices (before I discovered resizeTool). We'll check again, most probably with version 7.

Page: 1