Force the Side Bar to Appear Below Page Content on Mobile?
Darter02
Registered Users Posts: 947 Major grins
I'm redesigning parts of my site. They're not ready to be shared, so I can't provide a link just yet. On the page, I'm using a side bar to display certain navigation content. On a desktop computer the layout works well, with the page content on the left, and the side bar content on the right.
On mobile devices though the side bar appears first, and then you have to scroll down the see the page content. I'd like this to be in reverse, with the page content appearing first on mobile, and then the side bar content.
Does anyone know of a method to achieve this?
On mobile devices though the side bar appears first, and then you have to scroll down the see the page content. I'd like this to be in reverse, with the page content appearing first on mobile, and then the side bar content.
Does anyone know of a method to achieve this?
0
Comments
SmugMug Hero & CSS Monkey
https://help.smugmug.com/get-started-with-customization-SkgwJ4rM
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
If we had a content block that acted as a "container" for other content, like the sidebars do, it'd help with design. A container block we could place anywhere on a page, filled with whatever we wanted, imagine...
My apologies, I had a slight bug in the code that prevented it from working. The code below should work. I've added a CSS block to your Homepage with those code and tested it on your homepage and it makes it so that the "Essentials" section comes before the right sidebar "Experience." If that's not what you wanted, feel free to delete the CSS block (or let me know and I'll delete it).
I see you changed your wedding page to not have the right side bar. If you still wanted that, you could use this code to make it work how you requested above
I should be around for a few hours in case you reply and would like me to remove the CSS block that I added. I'll be away from the computer for a bit after but will check my email to see if you reply
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
And to those SM folks, I still want that container block.
Thanks! It's been an amazing first 3 months. Pretty much dream job come true! And I love to help you guys so it's a win-win for everyone!
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
The original code:
That seemed to work on my Droids, but apparently it doesn't work on the iPad which is 980px (right?). I've swapped the 670 for 980 but don't know if it worked as I don't have an iPad. Anyone with a better understanding, or an iPad? You can just click the site in the signature below to open the page I'm working on.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
It looks like this.
I'm trying to figure out why it doesn't work on the iPad. It's making a tad batty...
1) Desktop View: This is what you'll see when viewed in a computer with a monitor.
2) Mobile View: This is a shrunk down version of the page that is formatted to display on mobile devices.
Tablets fall into a little bit of a grey area in between. Is it a tablet big enough to display the Desktop view so that it's still readable or should it take on the mobile view?
We determine which version to load based on screen width*. If the screen width is <640 pixels we will display the mobile view. If it's >640 pixels we will display the tablet version.**
** (we're going to push a change shortly that increases this to 670 pixels so that iPhone6 will properly display as a mobile device).
* The other thing we take into account is the pixel density of a device. iPad Air's, for example, with a retina display, have more pixels per inch and therefore if we went by # of pixels alone, 640 pixels would look a lot smaller on an iPad Air 2 than it would look on an original iPad. Screen's with high density displays (like the retina display on the iPad Air) get a multiplier that can make it load the desktop display since it has the room to display it.
The Galaxy Tab has only 600 pixels for its width when held in portrait orientation and thus will display as a mobile device.
The iPad Air has 760 pixels for its width when held in portrait orientation and thus will display as a desktop device.
If you let me know which way you want them to display I can help make it so!
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Would that work? Or would it still scale incorrectly? I don't have an iPad Air to test it on.
This allows you to put in your web address and then select different screen sizes, tablets, mobile phones to see what it looks like.
www.acecootephotography.com
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Do I need to know the details of that fix in case I build another section similar to this one?
Essentially the main part of the page was leaving room for the right sidebar. The first part of the code gets rid of the room for the sidebar so that the content stretches the whole screen.
The second part of the code makes it so that the right sidebar, which is now below the main body, takes up the full screen.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
If so, it would be a lot easier if we had a way to create page templates.
edit: Oh, thank you once again!
I think we're all in agreement here on dgrin that this would be useful. Making that happen with the rest of our priorities is the trickier part! It's on my list of things I'd love to do one day.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations