-
AuthorPosts
-
oharris3 Friend
oharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 3:24 am #198495How can I make the menu sticky or fixed for this template?
Using a script from this post (http://www.joomlart.com/forums/topic/sticky-menu/), I inserted the script in header.php (in templatesja_medicaretplsblocks), but the menu now scrolls behind images or modules within each page. Please help.
Adam M ModeratorAdam M
- Join date:
- May 2014
- Posts:
- 5159
- Downloads:
- 33
- Uploads:
- 66
- Thanks:
- 95
- Thanked:
- 1271 times in 1235 posts
June 5, 2014 at 10:10 am #537868Hi,
The menu in JA Medicare is a bit different than JA Decor, so you might have to use another solution.
1. First, open root_foldertemplatesja_medicaretplsblocksheader (PHP) and look for this line :
<!-- HEADER -->
add this JS block right above it
<script>
jQuery(function() {var sticky_navigation_offset_top = jQuery('#t3-header').offset().top;
var sticky_navigation = function(){
var scroll_top = jQuery(window).scrollTop();if (scroll_top > sticky_navigation_offset_top) {
jQuery('#t3-header').css({ 'position': 'fixed', 'top':0, 'left':0 });
jQuery('#t3-header').next().css({ 'margin-top': jQuery('#t3-header').outerHeight() });
} else {
jQuery('#t3-header').css({ 'position': 'relative' });
jQuery('#t3-header').next().css({ 'margin-top': '0' });
}
};sticky_navigation();
jQuery(window).scroll(function() {
sticky_navigation();
});});
</script><!-- HEADER -->
2. Create new CSS file root_foldertemplatesja_medicarecsscustom (CSS). Please make sure that you MUST use the name custom and add these declarations :
.t3-header {
width: 100%;
background: #fff
z-index: 999;
}Save your file and check the result.
oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 1:54 pm #537890Thanks. It is now sticky or fixed, but upon scrolling down, the logo veers to the left and the header (includes menu and logo) still goes behind the images and module positions.
Additionally, the space (margin) between the menu module position and the slideshow module position has increased. See demo site at http://mof2.janadians.com/
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 3:36 pm #537913With regerd to the logo image “moving” upon scrolling, the culprit is the following CSS rule . .
.logo-image img {
margin-right: 10px;
}Within your custom.css file, paste the following (or modify if you already have it in there) . . .
.logo-image img {
margin-right: 1px;
}When I tested it out in Firebug, the logo didn’t move any more when scrolling down.
Hope That Helps (with that issue)
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 3:37 pm #537914<em>@oharris3 430863 wrote:</em><blockquote>
Additionally, the space (margin) between the menu module position and the slideshow module position has increased. See demo site at http://mof2.janadians.com/</blockquote>Which element is the “slideshow” within your demo site?
oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 4:07 pm #537920<em>@TomC 430890 wrote:</em><blockquote>With regerd to the logo image “moving” upon scrolling, the culprit is the following CSS rule . .
.logo-image img {
margin-right: 10px;
}Within your custom.css file, paste the following (or modify if you already have it in there) . . .
.logo-image img {
margin-right: 1px;
}When I tested it out in Firebug, the logo didn’t move any more when scrolling down.
Hope That Helps (with that issue)</blockquote>
Tried, but that does not resolve the issue. You can review online at the same domain.
oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 4:08 pm #537921<em>@TomC 430891 wrote:</em><blockquote>Which element is the “slideshow” within your demo site?</blockquote>
I have published the slideshow for you to see.
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 4:14 pm #537922How much space would you like the area reduced by?
Can you, perhaps, throw together a quick screenshot mock-up to show what it is you are wanting?
oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 4:22 pm #537923Not to worry about that aspect of it Tom. I was wrong. The space between the areas is quite fine. Sorry.
But the menu still scrolls behind the images.
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 4:38 pm #537925<em>@oharris3 430901 wrote:</em><blockquote>Not to worry about that aspect of it Tom. I was wrong. The space between the areas is quite fine. Sorry.
But the menu still scrolls behind the images.</blockquote>
What if you were to try this? . . . .
Within your custom.css file, paste the following:
.col-sm-12 {
z-index: 9999;
}oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 6:54 pm #537932It works, partially. Please view at http://mof2.janadians.com/
Note, the menu still veers to the left.
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 7:41 pm #537934<em>@oharris3 430916 wrote:</em><blockquote>It works, partially. Please view at http://mof2.janadians.com/
Note, the menu still veers to the left.</blockquote>
This is because you haven’t yet put the following within your custom.css file . . .
.logo-image img {
margin-right: 1px;
}oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 7:47 pm #537935Did that Tom. but the same thing happens.
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
June 5, 2014 at 8:03 pm #537937Do me a favor . . . please temporarily set “Optimize CSS” to “Off” within your Template Manager-General settings
oharris3 Friendoharris3
- Join date:
- June 2011
- Posts:
- 87
- Downloads:
- 60
- Uploads:
- 16
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
June 5, 2014 at 8:13 pm #537938<em>@TomC 430923 wrote:</em><blockquote>Do me a favor . . . please temporarily set “Optimize CSS” to “Off” within your Template Manager-General settings</blockquote>
Completed your request Tom.
-
AuthorPosts
This topic contains 21 replies, has 3 voices, and was last updated by Adam M 10 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum