• Resolved thunfischdose

    (@thunfischdose)


    Hi,
    first: Thanks a lot for this great plug-in. Worked instantly and looks perfect on mobile. Is there a way to adjust the height of the panorama with some css/js to a flexible height. E.g. I got full-width, full-height section in my theme where the curr view/ display size is set to the min-height of a div.
    How to adjust the height of a specific panorama to this min-height?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Leonardo Giacone

    (@leopeo)

    Hello @thunfischdose,
    thank you for contacting me, let’s try to solve this together.

    We can achieve this result with some line of Javascript and customising the HTML within your page

    Example:
    https://codepen.io/leopuleo/full/RKVQwd/

    Here you have more info about the code:
    https://codepen.io/leopuleo/pen/RKVQwd

    CSS
    Nothing to change.

    Javascript
    With these few line of code we are:

    • Choosing a specific panorama to target targeting
    • Calculating the panorama height: window height minus header height.
    • Forcing the panorama height with the new value

    Copy and paste the javascript from the example to a javascript file within your theme.
    Be careful to:

    • Change the panorama selector (line 4) in order to target the exact element you want to make full-height. Don’t use a generic .easy-panorama otherwise, all the panorama will be full-height.
    • Delete or comment line 6 – Easy Panorama is managing to initiate the panorama
    • Add or remove all the element placed above the panorama. In the example, we have only the #header element.

    HTML
    This is an example, remeber to add a container to your panorama, this must be full width.

    Remember: Easy Panorama uses Paver jQuery plugin, in case the author of this library changes the Javascript / HTML behaviour, this customization may not work.

    Please let me know if the example works for you.
    Leonardo

    Thread Starter thunfischdose

    (@thunfischdose)

    Worked like a charm!!!
    Did some adjustment but in reason of your perfect readable code this took me just some minutes. (I used $(‘.fullwidth_pan’).css(‘min-height’) in aboveFoldHeight function, else the wordpress-bar prevented true full-width)
    Thanks for the fast and perfect help!

    Plugin Author Leonardo Giacone

    (@leopeo)

    Good, I’m happy it’s working!

    I forgot to tell you one thing:

    from line 25 of the javascript, we are dealing with window resize.
    Every time the user resizes the window it destroys the panorama and re-initiate it assigning the calculated height.

    As you can see at line 37, we are initiating the panorama without any parameters, so if you customised the panorama behaviour/appearance via the plugin setting page, these won’t work after the window resize.

    I’m planning to add a custom method in the next version of the plugin, instead of initiating directly paver.

    I will let you know as soon as it’s ready.
    Leonardo

    Thread Starter thunfischdose

    (@thunfischdose)

    Thanks a lot for everything. I’m looking foward to the new version!
    In my case the paver destruction leads to very unsmooth effects (mostly on mobile when scrolling).
    I guess for most user (including me) a 100% height option would be fantastic.
    Very kind that you want to let me know when it’s ready!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Flexible height’ is closed to new replies.