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

0 padding not working? #266

Open
XBLDev opened this issue May 1, 2018 · 3 comments
Open

0 padding not working? #266

XBLDev opened this issue May 1, 2018 · 3 comments

Comments

@XBLDev
Copy link

XBLDev commented May 1, 2018

Hi

It seems when I give padding a 0, it defaults to 256? Is it my misunderstanding or is it just designed that way? i simply just want the menu to show without any sliding, for now I'm setting the padding to -1 which kinda makes it look like it opened without any sliding, but I can still see that 1px white edge.

Thanks in advance for any help!

@robertvrabel
Copy link

I'm looking to do the same! This way you can have an overlay menu rather than it sliding the content.

@anmatika
Copy link

anmatika commented Nov 1, 2018

I would also like to set padding as 0 but it seems not possible with the current implementation because it padding is set in like this.
this._padding = this._translateTo = parseInt(options.padding, 10) || 256;

And with 0 it becomes
parseInt(0, 10) || 256;
Which is
0 || 256

Which is 256

It could be fixed something like this but I'm not sure if the current implementation is intended behaviour of the library.

 var padding = parseInt(options.padding, 10);
 this._padding = this._translateTo = isNaN(padding) ? 256 : padding;

@robertvrabel
Copy link

It has been awhile since I did this, but I was able to get my desired outcome of having it overlay on the content.

    // Initialize slideout
    var slideout = new Slideout({
        'panel': document.getElementById('panel'),
        'menu': document.getElementById('menu'),
        'padding': -1,
        'tolerance': 70,
        'side': 'right',
    });

If you make the viewport small on https://base.wayne.edu you can click the hamburger icon in the upper right to see the outcome. If that is something you want to replicate I can share further code if necessary :)

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

No branches or pull requests

3 participants