Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-height on responsive only #2111

Closed
teolaz opened this issue Jun 22, 2016 · 8 comments
Closed

auto-height on responsive only #2111

teolaz opened this issue Jun 22, 2016 · 8 comments

Comments

@teolaz
Copy link

teolaz commented Jun 22, 2016

This is not a bug, this is more a request...
Is it possible to unbind the plugin (and the height calculation for sections) without destroying it only on certain screen formats?
As i can see, for now it's only possible to unbind the autoscroll with the "responsiveWidth" parameter, but nothing else.
I also tried to add an "fp-auto-height" on screen resize on all sections, but it's too late, cause plugin already assigned the height, and... well there's no event handler which starts only after the screen is resized but before the plugin is reinitialized.
Thanks
Teo

@alvarotrigo
Copy link
Owner

alvarotrigo commented Jun 22, 2016

As i can see, for now it's only possible to unbind the autoscroll with the "responsiveWidth" parameter, but nothing else.

Wrong. You can always use the method setAutoScrolling(false)

I also tried to add an "fp-auto-height" on screen resize

No need for that trick. Use the class fp-auto-height-responsive.
Needs documentation but its there for you to use.

What it does is apply auto-height only on responsive mode.

@alvarotrigo alvarotrigo changed the title Adding/removing fixed height on resize auto-height on resize Jun 22, 2016
@alvarotrigo alvarotrigo changed the title auto-height on resize auto-height on responsive only Jun 22, 2016
@teolaz
Copy link
Author

teolaz commented Jun 22, 2016

Maybe you misunderstood:

Is it possible to unbind the plugin (and the height calculation for sections) without destroying it only on certain screen formats?
As i can see, for now it's only possible to unbind the autoscroll with the "responsiveWidth" parameter, but nothing else.

I tried to say that there's nothing that could be used to unbind the height calculation...
As there's the "responsiveWidth" parameter to unbind the autoscroll, i was wondering if there's something you can add to unbind even the autoheight event.

No need for that trick. Use the class fp-auto-height-responsive.
Needs documentation but its there for you to use.

Well, i don't think it's a good idea to use it directly on code... you assigned every "fp-" class with plugin, best way is to continue assigning classes with it, don't you agree?
My proposal is to add a parameter as the "responsiveWidth" one, to unlock the fixed height and add your class only below the parameter value (i.e. 768px).

@alvarotrigo
Copy link
Owner

alvarotrigo commented Jun 22, 2016

As there's the "responsiveWidth" parameter to unbind the autoscroll, i was wondering if there's something you can add to unbind even the autoheight event.

Just overide it with CSS:

.removeFixedheight,
.removeFixedheight.fp-slide,
.removeFixedheight.fp-tableCell{
    height: auto !important;
}

You just have to add the class dynamically using javascript or jQuery.

But this way you will only be duplicating CSS code as that's exactly what fp-auto-height provides.

Well, i don't think it's a good idea to use it directly on code... you assigned every "fp-" class with plugin, best way is to continue assigning classes with it, don't you agree?

No, I do not agree. That's the whole purpose of that class. It is not used by the library otherwise.
fp- classes are just prefixed like so to avoid interference with any external library or developer classes. But they are mean to be used when necessary as stated in the docs.

@alvarotrigo
Copy link
Owner

Well, i don't think it's a good idea to use it directly on code...

I believe you didn't understand me correctly.

What I meant is that you can use it this way:

<div class="section fp-auto-height-responsive">Auto height</div>

Instead of:

<div class="section fp-auto-height">Auto height</div>

@teolaz
Copy link
Author

teolaz commented Jun 23, 2016

No need for that trick. Use the class fp-auto-height-responsive.

On which breakpoint this will affect the height precisely?

But this way you will only be duplicating CSS code as that's exactly what fp-auto-height provides.

No, i'm just asking a development request, as you can develop a small update that could help us with this thing... it's not just for me, it's for everybody :) as the "fp-auto-height" class needs to be inserted on window resize by me, and not by a small new feature of your plugin.

@alvarotrigo
Copy link
Owner

On which breakpoint this will affect the height precisely?

On the one you specify on the responsiveWidth or responsiveHeight options.

@faliqaiman
Copy link

@teolaz1990 not all users would like to have that fp-auto-height on each section when it's in a device viewport. That's why you need to insert those fp-auto-height by yourself. Or you can try to add those fp-auto-height by using addClass function.

@alvarotrigo
Copy link
Owner

Fixed in fullpage.js 2.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants