1 (edited by max 2014-11-25 12:54:23)

Topic: Adding custom buttons

Hello.

I want to add a button into the button area for another social platform.
I hook into onInitComplete and add HTML to DOM.

var buttonHTML = '/* Copy of Facebook button */';
document.getElementsByClassName('jb-bb-btn-facebook')[0].insertAdjacentHTML('beforeBegin', buttonHTML);

It works well, a new button is added,
but Juicebox set width to the parent element jb-classifier-link-wrapper hence this output:

http://storage5.static.itmages.com/i/14 … 350b6c.png

I can unset width from outside, but there are two things that blocks me:

1. Juicebox set width after onInitComplete is fired.
2. Juicebox set width every time window change size

Can you advice here? Or may be compile a version for me that doesn't set width?
Why do you force it in the first place?

Re: Adding custom buttons

Juicebox was not designed to allow users to add custom buttons to the Button Bar.
Juicebox will expect the Button Bar to be a certain size and in a certain position (determined by the Button Bar configuration options set in the gallery).
If you change the size or position of the Button Bar (using CSS and JavaScrtipt), Juicebox will not know of such modifications and you will encounter problems (such as the one you have reported when resizing the browser window).

Unfortunately, there is no easy solution to your problem as the code controlling what you are looking to change is within the 'juicebox.js' file which is obfuscated and modifying the source code is not supported.
Please see this FAQ: Does Juicebox-Pro include the source code?

Re: Adding custom buttons

Oh, no. I wanted to extend it with features that are absolutely mandatory.
I would need to append to HTML juicebox is generating.
I ask for refund then, what is the process for it?

Re: Adding custom buttons

Juicebox-Pro is very flexible (with well over 100 configuration options, an API so that the embedding page can interact with the gallery and the ability to use custom icons, themes, fonts and preloader) but it is not possible to add a custom button to the gallery's own Button Bar.
One possible workaround would be to create a custom button on your web page (alongside your gallery) and use the API to fetch information about the currently displayed image (for example to be sent to a social media platform via a share URL).

I ask for refund then, what is the process for it?

Please check your email. I have sent you a message. Thank you.

Re: Adding custom buttons

max:
I wanted a similar thing, in my case a back button in the top left corner of the screen. I did it with a small png with this style

    .bHome{z-index:999; position:fixed; top:0; left:0; height:45px; width:40px;}

with this line at the end of the page:

<img class="bHome" src="../PNGs/bHome.png" onclick="location.href='../index.html'" alt="Back.." title="Back..">

I have 51 JuiceBox galleries on my web site, for example http://www.brianwatsonphoto.co.uk/Birds/index.html using this technique more or less satisfactorily.

Hope this helps,

Brian

Re: Adding custom buttons

kilooloogung wrote:

max:
I wanted a similar thing, in my case a back button in the top left corner of the screen. I did it with a small png with this style

    .bHome{z-index:999; position:fixed; top:0; left:0; height:45px; width:40px;}

with this line at the end of the page:

<img class="bHome" src="../PNGs/bHome.png" onclick="location.href='../index.html'" alt="Back.." title="Back..">

I have 51 JuiceBox galleries on my web site, for example http://www.brianwatsonphoto.co.uk/Birds/index.html using this technique more or less satisfactorily.

Hope this helps,

Brian

Brian: that's a very nice, very clean, web page. I have a home button on my web pages, similar to your back button (e.g., http://www.billanddot.com/victory-xct/ ).

Unfortunately, what I think max wants is to add a button to the upper-right group of buttons, which I gather isn't possible.

Bill P.

Re: Adding custom buttons

@kilooloogung

Just in case you are not aware, Juicebox-Pro has built-in support for a Back Button (without the need for any manual coding) which can be either text or an icon.
Please see here for the available Back Button configuration options.

@wspollack

Unfortunately, what I think max wants is to add a button to the upper-right group of buttons, which I gather isn't possible.

That's right. It is much easier to overlay an HTML element on top of a gallery (which will always be in exactly the same place on the web page), as kilooloogung has done, than to try to introduce a new custom button within the gallery's own Button Bar (which would be fraught with problems, especially without access to the Juicebox source code).