Mobile theme modification
MarcQuinlivan
Registered Users Posts: 58 Big grins
Hi,
I'm trying to make a change to my site to change the behaviour on mobile devices.
Ideally, what I would like to do is change the viewport value at which the mobile theme is displayed.
If I view my site on an iPad Air I get the full desktop view in portrait and landscape mode.
On my iPhone 6 I get the mobile view in portrait and landscape mode.
On my LG Nexus 5X I get the mobile view in portrait and the desktop view in landscape.
The desktop view kicks in when the viewport is 670 pixels wide and below this the browser displays the mobile view.
This is all as expected, however the problem I have is that my menu bar only displays properly at a viewport width of 980 pixels.
I tried to use Aaron's customisation to remove the social icons menu at the right hand side of the menu bar in desktop mode, and while this worked it did not hide the column. There are three columns in the menu bar and they all appear to have the same identifier.
What I want to know is:
1) Is there a way to force the mobile view when the screen width is lower than a certain number of pixels?
2) Is there a way to hide the social icons column below a certain width and then make the navigation menu column fill the gap it has left.
At the moment my columns are 18% (logo), 64% (navigation menu) and 18% (social icons).
I would like to have this as 18% (logo) and 82% (navigation menu) if the screen width is between 670 and 980 or 1000.
I hope that makes sense.
I will attach screenshots from each device to hopefully make things clearer.
The site is www.alyxcoby.com
I'm trying to make a change to my site to change the behaviour on mobile devices.
Ideally, what I would like to do is change the viewport value at which the mobile theme is displayed.
If I view my site on an iPad Air I get the full desktop view in portrait and landscape mode.
On my iPhone 6 I get the mobile view in portrait and landscape mode.
On my LG Nexus 5X I get the mobile view in portrait and the desktop view in landscape.
The desktop view kicks in when the viewport is 670 pixels wide and below this the browser displays the mobile view.
This is all as expected, however the problem I have is that my menu bar only displays properly at a viewport width of 980 pixels.
I tried to use Aaron's customisation to remove the social icons menu at the right hand side of the menu bar in desktop mode, and while this worked it did not hide the column. There are three columns in the menu bar and they all appear to have the same identifier.
What I want to know is:
1) Is there a way to force the mobile view when the screen width is lower than a certain number of pixels?
2) Is there a way to hide the social icons column below a certain width and then make the navigation menu column fill the gap it has left.
At the moment my columns are 18% (logo), 64% (navigation menu) and 18% (social icons).
I would like to have this as 18% (logo) and 82% (navigation menu) if the screen width is between 670 and 980 or 1000.
I hope that makes sense.
I will attach screenshots from each device to hopefully make things clearer.
The site is www.alyxcoby.com
0
Comments
As you can see "sm-page-layout-row yui3-g" is the area corresponding to the entire menu bar.
Under that are three DIVs which hold the columns (logo, navigation, social icons). They all have the same identifier "sm-page-layout-column yui3-g".
Is there a way I can target the third column with CSS and set it to "display:none" and then modify the second column's properties so that it is "width: 82%", or even change column 1 to be a pixel value and column 2 to be the rest of the screen width?
Hopefully that makes what I'm trying to achieve a bit clearer.
I've manually edited the source in using Chrome and it looks fine.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I have used the following code and it now does what I want.
I only wanted it to remove the social icons between 671 and 1000, so they wouldn't be removed from the mobile view so I added a "min-width" to it too.
Thanks for your help.
The image below is at 671px wide. Mobile view displays as in my original post at 670px and below while the full desktop view appears above 1000px.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
/*Hide the mini left slideshow for mobile browsers */
@media only screen and (max-width: 480px) {
.sm-user-ui .sm-page-widget-5615980 { display: none !important; }
}
margygreen.com