Custom Navbar to long for iphone
ko04
Registered Users Posts: 370 Major grins
Hey everyone,
I have been ignoring this problem for awhile but since I am finally done with my site I can no longer ignore it. I have a custom navbar using a html/css block and I am noticing it is being cut off and not fitting on the iphone. I used this link http://iphone4simulator.com and viewed the css and I can see that it has its own but I don't really know what I should be doing with it or what code to use for just fixing the navbar on mobile phones. Another question I would have is that if its possible to have two different navbars one that is custom like mine and one that is more iphone/mobile phone friendly. I hope I am explaining this well enough and if anyone has any thoughts on this I'd greatly appreciate it. My website is www.k-ophotography.com. Thanks in advance!
KO
I have been ignoring this problem for awhile but since I am finally done with my site I can no longer ignore it. I have a custom navbar using a html/css block and I am noticing it is being cut off and not fitting on the iphone. I used this link http://iphone4simulator.com and viewed the css and I can see that it has its own but I don't really know what I should be doing with it or what code to use for just fixing the navbar on mobile phones. Another question I would have is that if its possible to have two different navbars one that is custom like mine and one that is more iphone/mobile phone friendly. I hope I am explaining this well enough and if anyone has any thoughts on this I'd greatly appreciate it. My website is www.k-ophotography.com. Thanks in advance!
KO
KO Photography
http://www.k-ophotography.com/
http://www.k-ophotography.com/
0
Comments
You will need to write your CSS code for your site to be mobile friendly if you want this to appear correctly on different devices. This means you will have to write additional css that is called up by device type or screen size. You will need to develop this on your own. You can always us the built in navigation options and then alter the styling to meet your needs, this may be better overall for functionality.
Your navigation bar may work better if you change several area widths from a fixed pixel size to a percentage as well.
-Scott
Thanks for the suggestions. I am curious to try the the percentage instead of a fixed pixel though I am not sure what code like that looks like since my coding skills is very limited. Would you or anyone else be willing to show me what something like that would look like. Incase you need it this is what my coding looks like right now
The main part in question for the percentage change would be here . Lastly the reason I don't want to use SM's navbar is because if I decide to switch back to having my blog intergraded I can't seem to figure out what code I use when using the SM's navbar in my blogger templet. As of right now I have a feed block but I might be changing that. When using a custom navbar its a lot easier to add in my blogger templet. Anyways thanks a lot Scott for your suggestions it is very much appreciated.
http://www.k-ophotography.com/
I do exactly this on my site. On my iPhone a mobile-friendly page is automatically loaded by SmugMug. But on the iPad, when held vertically (portrait orientation) my menu bar, thumbnails, and photo (SmugMug Layout) don't fit. Using CSS and a 2nd content block I hide the left (vertical) navbar and show a header (horizontal) navbar. Here's what I did.
I have 2 navbars ... one is in the HEADER of the page (a horizontal one) and one is in the LEFT SIDEBAR of the page. They are both enabled in "ENTIRE SITE". My "left sidebar" has a LOGO, a MENU BLOCK, and SOCIAL ICONS. My "header navbar" has a LOGO and a MENU BLOCK.
I then use CSS to determine the screen width and hide one of them. Here's the code:
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Thanks for the help on this leftquark what you are suggesting is exactly what I want to do but from the sounds of it your are using smugmugs navbar blocks. I am using custom css for my navbar so my question to you or anyone else that could help me with this is what then would I use for the ID on large screens for my navbar. I am going to use a smugmug navbar block for the vertical display for mobile and smaller screens, so I should be good on that end I just need an ID for my custom navbar. Any suggestions on this would be greatly appreciated!
http://www.k-ophotography.com/
It looks like you have added an HTML/CSS block to your page to do your custom navbar?
The HTML starts with some code like this ... right?
It makes things easier if you also have class names associated with div's and not just ID's. You reference CLASS names with a "." before the class name (i.e. .cssmenu) and you reference ID's with a "#" sign (i.e. #cssmenu).
I would suggest changing your HTML for this by adding: class="cssmenu" as follows:
For small screens you would want to hide this and for large screens you would want to hide the smugmug navbar
Note, you may need to change ".sm-page-layout-region-header" to something else. In my case I am hiding my ENTIRE header. In your case, I think you actually use the header so you'll need a css class slightly more specific. Make sense?
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
First off I want to thank you for such a quick response and your wiliness to help me with this is all much appreciated! So I was right with you until the end where you said this . If you don't mind explaining that a little that would be great.
I probably won't work on this right away but if I have any questions I will post back. So keep a look out for any questions. Since I am very much a beginner when it comes to coding and such chances are I will have a question haha. Thanks again!
http://www.k-ophotography.com/
SmugMug breaks the site top-down first: header, body, footer.
- Most likely you've placed your custom navbar in the "header".
- The "body" is broken into left, right, and center. The left and right can house a "sidebar", although it looks like yours are set to OFF. The "center" is where all of your images are displayed.
Every section, and all the little pieces inside the site are given "divisions" or (< DIV >) code. Each one has a class name "class=WHATEVER". You can reference these classes with CSS and customize each of them.
Divisions build off each other. So if you have your custom navbar inside your "header" section you can reference the navbar by itself or you can reference it as part of being in the header. What this mean is, you could call out in your CSS:
.cssmenu { someOptions; }
(any instance of "cssmenu")
or you could call it out as part of it being in the header ... in CSS it builds upon itself when seperated by a space ... so something like:
.headerDiv .cssmenu {someOptions; }
If you had 2 cssmenus, for example, 1 in the "header" and one in the "body" you could target a specific one.
.bodyDiv .cssmenu { someOptions; }
or
.headerDiv .cssmenu {someOptions; }
Or you could target both:
.cssmenu { someOptions; }
With me so far?
For my website I don't use the "header" at all ... except to put my temporary navbar. It has a LOGO content block and a MENU content block in it. The rest of my site has a LEFT sidebar that has my LOGO and a different MENU block.
For all pages except vertical iPads I wanted to hide the logo and the menu that was in the header. I would have had to write 2 seperate lines of code: one to hide the logo in the "header" and one to hide the menu in the "header" ... but I realized I could hide the entire "header" and accomplish this with one line of code:
By calling out the name "sm-page-layout-region-header" I'm calling out the entire "header" and EVERYTHING that's in it. It's now hidden.
You use the header so this is could to be a bad piece of code for you.
You'll need to Inspect your page's code and drill down deeper. Look at the divisions within your header and find the division where the SmugMug menubar is. If it's a horizontal menubar you'll see some code that might say:
That's giving that section of code a LOT of CSS definitions with it. I've bolded a really important one. That "sm-page-widget-nav-horizontal" is the horizonal navbar that smugmug places (I looked at someone elses page that uses a horizontal navbar). That's the name of the division you want to hide.
It looks like if you place a vertical navbar it'll be called "sm-page-widget-nav-vertical".
So you'll need to change the above code to read something more like:
Follow?
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
http://www.k-ophotography.com/
I feel like I am getting so close here but yet so far! I was able to hide the navbar I am going to use for my mobile on larger screens but on my iphone my navbar "cssmenu" that I use for larger screens is still showing up. If you could look at my code and see what I am doing wrong I have tried doing all sorts of combo's that I think my navbar id/classes are but none of them are working. Here is my code:
Thanks in advance!
http://www.k-ophotography.com/
You don't use the CSS menu and "myHeader" anywhere except in the one spot that you're trying to hide, so don't make it so complicated. Stick to the simple names of just "cssmenu" and "myHeader".
When you put all the other .sm-page-widget ... blah blah blah, it starts making it way more restrictive and you can end up blocking what you're trying to do.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I am not getting why this isn't working I have tried simplifying everything that didn't work tried making it more specific that didn't work. I don't know if my ID/Classes are wrong or what. I tried all different types of classes that I saw through out the code none of them seemed to be the one that made things right. So currently this is how things stand the navbar I want to use for my mobile site doesn't show up on large screens. The navbar I want to use for my large screens shows up on mobile sites. Then the navbar for my mobile site doesn't show up on the mobile. Currently this is what my code looks like. This is kind of over my head and I'm taking on something larger then what I can understand but I am up for the challenge its just stumping me like crazy. Let me know your thoughts.
http://www.k-ophotography.com/
What kind of navbar did you insert for mobile devices? Did you add it into a left sidebar? I don't remember your site having a left sidebar? Did you put the (mobile version) of the navbar in the header? If so, I'm surprised any of that code works ... Notice how you're calling out "nav-left" instead of a nav-header?
Your code for large displays and ipads/small monitors is redundant -- it's exactly the same. No need to break it into 2 chunks. In the "large displays" section just change that "801px" to "641px" and you're covered. Then delete the ipads/small monitors section.
I'm not sure why your code to remove the .cssmenu and .myHeader aren't working. I tested the code I gave you on your site and it worked perfectly (although I didn't have .sm-page-widget in it). Where are you putting the code? Into your theme's advanced CSS section? or in a CSS block?
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
So I got things working where it hides the mobile navbar just fine on large screens the trouble is still isn't working for the hiding of my large navbar. When I add this code everything goes away on the large screen but the mobile version works. So that makes me wonder if there is something wrong with that code. I too tried a "display: none" on my header and cssmenu but when I inspect it thats where I see the code and . When I display none on both those using google chrome's web designer tools it works just fine.
I currently only have this as my code and as I said its hiding the mobile navbar just fine
This is the whole code together that I am trying to use but doesn't work Any thoughts? I really appericate all your time on this and if this is troubling you to much then don't worry about it. Its probably on my end and not really understanding code very well.
http://www.k-ophotography.com/
Yes, and it's a teeny little mistake. In the very end of your "for mobile screens" section, you're missing the final "}" to close out the statement:
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Its still hiding the whole large navbar all together on large sizes and on mobile even with that change.
http://www.k-ophotography.com/
I searched through the code on your site and I don't see the CSS to hide the menu bars anywhere. Where are you putting the CSS?
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
My Website index | My Blog
AHAHAHA. Now *that's* why I don't see the code showing up AT ALL ... and why it's not working
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
http://www.k-ophotography.com/
--- Denise
Musings & ramblings at https://denisegoldberg.blogspot.com