nicolas-t / Chocolat

Chocolat : the lightbox so cool horses use it :horse:
http://chocolat.insipi.de
GNU General Public License v3.0
1.69k stars 170 forks source link

Automatically Showing controls #92

Closed njiels closed 5 years ago

njiels commented 6 years ago

Hi, sorry if this is kind of a simple question but is there any way to showing the controls automatically when refreshing/entering a page? Right now I have to click on the image for it to show the controls. This is not very user friendly.

Also, is there any way for buying you a coffee ;) chocolat has helped me out a lot!

nicolas-t commented 6 years ago

Hello,

You want to open the image as soon as you arrive on the page ? Then this issue may help you : https://github.com/nicolas-t/Chocolat/issues/71

It should look like this :

$(document).ready(function () {
    var instance = $('#your-selector').Chocolat({ 
        // ...
    })

    instance.api().open() 
})

Did I understand you question correctly ?

I'm glad you're enjoying Chocolat! (but there is no way of buying me a coffee :sweat_smile:)

njiels commented 6 years ago

Thanks for answering so fast, and sorry for answering so late myself. This opens the gallery fullscreen, but i want the gallery to be showed in a container, but right now it only shows a thumbnail (so without controls). The result i'm aiming for is something like the in-container example on the chocolat website.

nicolas-t commented 6 years ago

First you have to define an html element that will be your contained, for example :

<div id="chocolat-container" style="width: 800px; height: 600px;"></div>

then you can use the setting container like this :


$(document).ready(function () {
    var instance = $('#your-selector').Chocolat({ 
        contained: '#chocolat-container'
    })

    instance.api().open() 
})
nicolas-t commented 5 years ago

Closing due to inactivity. Feel free to reopen