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

Pushpin and grid push/pull conflict #3480

Closed
lucafaggianelli opened this issue Aug 9, 2016 · 3 comments
Closed

Pushpin and grid push/pull conflict #3480

lucafaggianelli opened this issue Aug 9, 2016 · 3 comments

Comments

@lucafaggianelli
Copy link

Hi,

I have a right menu and the main content, on small devices I need the right menu to go on top and take the full width (s12), the main content goes below the menu and is also s12.

<div class="row">
  <div id="right-menu" class="col m4 push-m8 s12">
  </div>

  <div class="col m8 pull-m4 s12">
    <p>Content</p>
  </div>
</div>

Then I tried to pushpin the rightmenu:

var menu = $('#right-menu');
menu.pushpin({ top: menu.parent().offset().top });

The menu is correctly pushpinned and it's correctly pushed on the right side, but the main content is out of the view port on the left. Moreover on small device I don't want to pushpin it, how can I do?

Here the page with the menu I'd like to pushpin http://datalogic.github.io/tutorials/barcode-scanner-html5.html

Summarizing:

  1. Is there any incompatibility with pushpin and grid push/pull?
  2. How to not pushpin on small screens?

Luca

@acburst
Copy link
Collaborator

acburst commented Aug 11, 2016

You should try and avoid adding things that will alter .col divs. Pushpin changes the position of the div which will break our grid system.

You can fix this by adding a wrapper class for your pushpin menu like this:

<div class="row">
  <div class="col m4 push-m8 s12">
    <div id="right-menu">
      right menu
    </div>
  </div>

  <div class="col m8 pull-m4 s12">
    <p>Content</p>
  </div>
</div>

@lucafaggianelli
Copy link
Author

Thanks for the help! Actually I already have a wrapper, but is not working. Now I found a workaround setting #right-menu height to 1px, because the .col had a 0px height.

Any advice on how to unpin the menu on small screens? Is there a JS event for screen size change between S/M/L? so I can call pushpin('remove')... Sure I can listen to window resize, but I would avoid it

@fega
Copy link

fega commented Apr 9, 2017

Hello @lucafaggianelli Did you solve the issue?

Closed due inactivity, feel free to reopen it if it is still necessary.

@fega fega closed this as completed Apr 9, 2017
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