Community Forums › Forums › Archived Forums › Design Tips and Tricks › Altitude Header Tweak
Tagged: altitude
- This topic has 20 replies, 4 voices, and was last updated 9 years, 9 months ago by
Erik D. Slater.
-
AuthorPosts
-
June 9, 2015 at 6:19 am #155562
ghog
MemberI am using Altitude Pro and would really like to style the header similar to this: http://j.mp/1B31gYT
http://violetafinance.rareagency.co/
But have no idea how. Could anyone please help me with this?June 9, 2015 at 11:39 am #155596Erik D. Slater
MemberThe comparison site displays a few images using a slider-esque approach ... quite nice, actually 🙂 So I'm not sure to which image you refer.
So I'm wondering what you meant by "style" here. Were you thinking/hoping it could be done using CSS? Were you pointing to the image-rotation idea?
Erik D. Slater: Digital Platform Consultant • LinkedInJune 9, 2015 at 12:43 pm #155609MoodyRiviera
MemberI'm wondering the same thing as Erik is wondering...are you referring to the "slider effect"...or are you referring to the cool "Honest Folks," "Motion," and "HandCrafted" text effects? If referring to cool text effects, those are created in a graphics program such as Photoshop or Illustrator and then inserted into the slider. I don't think you're going to get anything to look like those using CSS.
*MoodyRiviera*
June 9, 2015 at 1:54 pm #155616Erik D. Slater
MemberJune 9, 2015 at 4:53 pm #155636ghog
Memberoh sorry guys I should of been clearer. i was actually referring to the navigation style of the solid block of colour with slight transparency that runs behind the menu items. By default Altitude is completely transparent with a single white line positioned under the menu. And yes I was hoping I could replicate this style with CSS. Thanks for your responses so far.
June 9, 2015 at 5:19 pm #155641Erik D. Slater
MemberSooo ... you don't want the white line on your navigation menu, right?
aaaand ...
You do want your navigation menu background to have a transparent look, right? If you like, I can even give you the exact background used on Grain & Mortar 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 9, 2015 at 6:53 pm #155652ghog
Memberyes please I would really like to replicate their navigation, just with a few differences in height and fonts.
June 9, 2015 at 8:12 pm #155660Erik D. Slater
MemberIn your style.css file, all the action happens between lines 918 and 928, which looks like this:
.featured-section .site-header { background-color: transparent; } .featured-section .site-header > .wrap { border-bottom: 1px solid #fff; } .site-header.dark { background-color: #000; }
So then ...
To remove the white border, remove the
.featured-section .site-header > .wrap
definition (all three lines).To add the transparent background you're looking for:
(1) replacebackground-color: transparent;
withbackground: rgba(0, 0, 0, 0.5);
(2) remove the.site-header.dark
definition (all three lines - gets used when you scroll down)Grain & Mortar uses
background: rgba(26, 26, 26, 0.25);
... so if you want to use those then apply the change to (1) above.
Erik D. Slater: Digital Platform Consultant • LinkedInJune 9, 2015 at 8:37 pm #155663ghog
Memberhey Eric thank you so much that is amazing help mate. i added your changes and all works great. I experimented with the values but couldn't work out how to darken the transparency. Could you please explain how that works?
June 9, 2015 at 8:58 pm #155664Erik D. Slater
MemberExcellent question 🙂
The rgba parameters translate to rgba(red, green, blue, alpha transparency) ... so you would need to fiddle with that fourth number - the alpha transparency - inside
background: rgba(0, 0, 0, 0.5);
, i.e. the 0.5. The value ranges from 0 (fully invisible) to 1 (fully visible) ... so things get darker as you tend towards a value of 1.I should say that normally I would use background-color for this sort of thing ... but background works too.
Erik D. Slater: Digital Platform Consultant • LinkedInJune 9, 2015 at 9:09 pm #155665ghog
MemberAwesome. Thanks for all your help Eric.
June 9, 2015 at 9:13 pm #155666Erik D. Slater
MemberJune 10, 2015 at 3:51 am #155700anhlamgame
Memberoke men
Công ty [url=http://edena.vn/]Đệm[/url] Edena chuyên bán các loại [url=http://edena.vn/san-pham/nem/dem-nem-lo-xo-edena]?‘ệm lò xo[/url] và [url=http://cuscino.vn/san-pham/nem/nem-bong-ep.html]nệm bông ép[/url]
June 21, 2015 at 6:20 am #156984ghog
MemberHey Erik, I would like to make a small change to this menu styling and was wondering if you mind assisting me once more please? What I want to achieve is the look of the menu/navigation when the page scrolls to be common throughout. Currently the header logo and navigation reduce in size when the page scrolls and I would like to have this appearance by default. So in essence I would like to remove the default state and just display the scrolled state all the time. Hope this makes sense 🙂
Thanks
June 21, 2015 at 10:26 am #156996Erik D. Slater
MemberYep, no problem 🙂
Perhaps the cleanest way to achieve this is to only modify the JavaScript file that makes that magic happen. You would have to modify it anyway.
Pop yourself into a file called global.js ... which you will find under:
wp-content -> themes -> altitude-pro -> jsDon't panic if code isn't your thing. This is a very small file ... and we are only working with the first few lines at the top 🙂
Then, change the following code from:
if( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'dark' ); } // Add opacity class to site header $( document ).on('scroll', function(){ if ( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'dark' ); } else { $( '.site-header' ).removeClass( 'dark' ); } });
to
/* ALL THAT JAVASCRIPT CODE YOU SEE ABOVE */ $( '.site-header' ).addClass( 'dark' );
In other words, we are:
(1) adding /* before the code block
(2) adding
*/
$( '.site-header' ).addClass( 'dark' );
after the code blockGive that a whirl, then check back in 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 21, 2015 at 6:01 pm #157060ghog
MemberThanks again Erik. One last thing, do you have any clue why the navigation still does not display on the home page and only on the inner pages?
thank you
June 21, 2015 at 6:18 pm #157062Erik D. Slater
MemberAhhhh ... you didn't quite follow my instructions there. You added the open comment too early ... and you didn't add the crucial line that makes the magic work 🙂
Here is the full code for that file, complete with my initial proposal:
jQuery(function( $ ){ /* if( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'dark' ); } // Add opacity class to site header $( document ).on('scroll', function(){ if ( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'dark' ); } else { $( '.site-header' ).removeClass( 'dark' ); } }); */ $( '.site-header' ).addClass( 'dark' ); $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).addClass( 'responsive-menu' ).before('<div class="responsive-menu-icon"></div>'); $( '.responsive-menu-icon' ).click(function(){ $(this).next( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).slideToggle(); }); $( window ).resize(function(){ if ( window.innerWidth > 800 ) { $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu' ).removeAttr( 'style' ); $( '.responsive-menu > .menu-item' ).removeClass( 'menu-open' ); } }); $( '.responsive-menu > .menu-item' ).click(function(event){ if ( event.target !== this ) return; $(this).find( '.sub-menu:first' ).slideToggle(function() { $(this).parent().toggleClass( 'menu-open' ); }); }); });
Erik D. Slater: Digital Platform Consultant • LinkedInJune 24, 2015 at 10:48 pm #157477ghog
MemberThanks Erik, that has worked 90%. The only thing missing now is the background in the navigation. It is displaying on the inner pages but not on the home page.
Thanks
June 24, 2015 at 11:31 pm #157479Erik D. Slater
MemberYou didn't copy the contents above, then paste it into your global.js file 🙂
You are still missing the following line (which is supposed to appear immediately AFTER the */ bit) ... which is required to make the whole thing work WITHOUT additional CSS changes:
$( '.site-header' ).addClass( 'dark' );
The only inner page I could find was your Services page ... and it looks like you modified the CSS to get the background colour working there.
Alternatively, if you don't want to make any additional changes to your global.js file, remove the following CSS definition from your style.css file:
.featured-section .site-header { background-color: transparent; }
I was trying to keep things nice n simple for you ... just in case you wanted to revert back to the original. Best laid plans n all that 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 25, 2015 at 2:03 am #157489ghog
Memberahhhh my bad. thanks Erik, you da man 🙂
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.