Floatbox Size by percentage of image size

Page: 1

Author Post
Member
Registered: Aug 2012
Posts: 6
My client wants to limit the size of the images to about 3/4 (75%) of the max size (actual size of the images)

Is there a way to do that?

I tried addgin data-fb-options to the shortcode
[gallery include="65,64,66,67,73,81,72,75,69,71,78,80,68,77,74,79,76,70" link="file" data-fb-options="width:75% height:75%"]

and tried specific sizes (which would distort the images and it had no effect anyway [gallery include="65,64,66,67,73,81,72,75,69,71,78,80,68,77,74,79,76,70" link="file" data-fb-options="width:375 height:300"]

Please help.
http://lemacaron-us.franksdesigns.com/#collection
Administrator
Registered: Aug 2008
Posts: 3382
Hi,

When you speak of 'shortcode' you are referring to wordpress entities and possibly a wordpress plugin. I can't help with that stuff. Floatbox is neither a wordpress component nor is it a wordpress plugin. You'll need to find the appropriate support channels for those things if that's what you need assistance with.

You are certainly on the right track by setting width and height in the data-fb-options. If you've ended up with wrong image proportions then you just need to assign different numbers of the right proportion.

But by far the best way to meet this requirement would be to use an image editor to size the images to the dimensions that you want them to be displayed at, and then allowing them to display at their native dimensions.
Member
Registered: Aug 2012
Posts: 6
Yes I'm speaking of the gallery shortcode - part of wordpress.

I would be happy to change global options, etc. js files but other things I"ve tried in those files have not had any impact so I didn't even try that with this.

I will resize wordpress images.
Member
Registered: Aug 2012
Posts: 6
I just thought of something. Is there a way to tell Floatbox to use the Medium size images instead of the "ORIGINAL" size for the lightbox?
Administrator
Registered: Aug 2008
Posts: 3382
You mean with multi-picture jpegs? No, sorry. The main floatbox element when showing an image is a standard <img> element and will show only what the browser shows based on the "src" attribute - namely, the primary image.

But I just thought of something potentially useful to you. There's maxContentWidth and maxContentHeight options available. They won't let the images be displayed larger than the values set, and the image will be scaled proportionally to fit. Here's the blurb from the Options Reference:

Quote
maxContentWidth (0), maxContentHeight (0) - pixels
maxContentWidth and maxContentHeight set the upper size limits for floatbox content dimensions. When set to 0, no limit is in effect and the content will be presented at its native, specified or measured size.
If these options are applied to image content and are smaller than the image's native dimensions, the image will be resize-able up to native dimensions (provided the enableImageResize option has not been set to false).
Member
Registered: Aug 2012
Posts: 6
Thank you. This highly customized website is designed to be VERY mobile friendly.

can maxContentWidth (0), maxContentHeight (0)

be specified on a specific gallery vs. globally?
See this page: http://lemacaron-us.franksdesigns.com/#collection
Member
Registered: Aug 2012
Posts: 6
maxContentWidth (0), maxContentHeight (0) (where? Options.js floatbox.js?)

I'm using Floatbox Plus Plugin in Wordpress
Administrator
Registered: Aug 2008
Posts: 3382
Sorry, I don't (can't really) support, and I don't like, the so-called 'floatbox-plus' plugin. One of the main reasons why I don't like it is because it greatly limits and hides the capabilities of the Floatbox library that it depends on. I have nothing to do with the floatbox-plus plugin and it is not part of the Floatbox library.

The Floatbox instructions talk about how and where Floatbox options can be set. I've also got a document up at http://floatboxjs.com/wordpress/ that shows you how you can use the Floatbox library directly in WordPress without any plugins. The great advantage of this approach is that you have access to all Floatbox capabilities and can use the Instructions and Options Reference as guides to implementing those capabilities.

Floatbox options can be set per item in the data-fb-options attribute, per page in an fbPageOptions object, globally in the options.js file, per content type in both options.js and fbPageOptions, and assigned to classNames globally and per page as well. It's actually quite straight-forward and well documented, but you need access to and the ability to edit the page's html in order to do any of that.
Member
Registered: Aug 2012
Posts: 6
Thank you, I appreciate this information - I prefer to avoid plugins too! :)

Page: 1