-
AuthorPosts
-
costabreeze Friend
costabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 12:10 am #193391Hello Happy new year All
i need code to make Main Menu (navbar) fixed for the top but only after the page is scrow down. the same like Ja Magz template navbar, and where to put the code?
thanks !
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
January 2, 2014 at 12:19 am #517069So that we can try to best assist you, please provide the url of the site you’re working on,
as well as set “Optimize CSS” to “No” within your Template Manager–Options–General settings1 user says Thank You to TomC for this useful post
costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 12:34 am #517070http://www.gamebreeze.net
Optimize CSS – NO
thanksi try with something like navbar-fixed-top but the navbar going over the header were is the logo..
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
January 2, 2014 at 1:35 am #517072Try This . . . .
Within file path –> templates/ja_obelisk/css/template.css
at line 1946, add the following properties – as follows:
.t3-mainnav {
background: none repeat scroll 0 0 #151515
border-bottom: 0 none;
border-top: 0 none;
position: fixed;
width: 100%;
top: 40px;
}then, at line 5366, modify as follows:
.t3-header {
background-color: #F8F8F8
background-image: linear-gradient(to bottom, #FFFFFF, #EEEEEE)
background-repeat: repeat-x;
padding-bottom: 20px;
padding-top: 20px;
position: fixed;
width: 100%;
}There’s a bit more to do with it, but see if that is going in the right direction.
1 user says Thank You to TomC for this useful post
costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 2:21 am #517076Yes thats going in right direction but forgot for t3-header i dont want t3-header fixed, need to be hide when somebody scrow down a bit the webpage(i dont gonna use the code for t3-header).
1 Now t3-mainnav has to be fixed for top (0px) but only when the page scrow down a bitand need to be fixed some bugs i see now when i scrow down the page the modules with adsense code are over the t3-mainnav! dont need to be like that t3-mainnav shoud stay over every module on site page right ? (edit only adsense code not the module)
i use only
at line 1946, add the following properties – as follows:
Code:
.t3-mainnav {
background: none repeat scroll 0 0 #151515
border-bottom: 0 none;
border-top: 0 none;
position: fixed;
width: 100%;
}at line – 5590
.t3-mainbody {
padding-bottom: 40px;
padding-top: 65px;
}I use different t3-mainbody padding because on my site t3-header padding is different from default code on ja obelisk !
check on my site how is it now
costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 2:43 am #517079i add to t3-mainnav
z-index: 99999;
now ALWAYS appears above anything on a page!
only left to be fixed right for the top after scrolling down the page… but i dont know this how to do it ( ithink its java code rirht?)
i found this for reference if helps ( maybe we can use ja magz javascript ??? )
http://stackoverflow.com/questions/1216114/how-can-i-make-a-div-stick-to-the-top-of-the-screen-once-its-been-scrolled-tophong nam Friendphong nam
- Join date:
- May 2015
- Posts:
- 3779
- Downloads:
- 1
- Uploads:
- 587
- Thanks:
- 499
- Thanked:
- 974 times in 888 posts
January 2, 2014 at 7:27 am #517107You can try to put override css styles below into the end of template.css file:
.t3-header {
margin-top: 45px;
}.t3-mainnav {
top: 0;
}1 user says Thank You to phong nam for this useful post
costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 1:22 pm #517158<em>@Leo Burnetts 404157 wrote:</em><blockquote>You can try to put override css styles below into the end of template.css file:
.t3-header {
margin-top: 45px;
}.t3-mainnav {
top: 0;
}
</blockquote>not this ! how i say i need the efect of ja magz template mainnav :confused:
leave t3-header its nothing about itCheck this example.
costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 2:10 pm #517164Can you help me with this simple ?
$(document).ready(function() {
// Cache selectors for faster performance.
var $window = $(window),
$mainMenuBar = $('#mainMenuBar'),
$mainMenuBarAnchor = $('#mainMenuBarAnchor');// Run this on scroll events.
$window.scroll(function() {
var window_top = $window.scrollTop();
var div_top = $mainMenuBarAnchor.offset().top;
if (window_top > div_top) {
// Make the div sticky.
$mainMenuBar.addClass('stick');
$mainMenuBarAnchor.height($mainMenuBar.height());
}
else {
// Unstick the div.
$mainMenuBar.removeClass('stick');
$mainMenuBarAnchor.height(0);
}
});
});costabreeze Friendcostabreeze
- Join date:
- May 2013
- Posts:
- 29
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 11
- Thanked:
- 5 times in 1 posts
January 2, 2014 at 2:43 pm #517170job done 🙂
i add this css code in template.css file (clone from ja magz template)
.t3-mainnav.min-mainnav {
width: 100%;
top: 0;
}
.affix {
z-index: 1030;
}then i copy from ja magz/js/script file to ja obelisk/js/script file this
// add class for mainmenu when scroller
(function(){
var min = null,
sid = null,
mainnav = $('#t3-mainnav'),
navbar = mainnav.find('.navbar:first'),
breakpoint = navbar.length ? navbar.offset().top : 0;if(mainnav.length){
$(window).scroll(function() {if(min != $(window).scrollTop() > breakpoint){
min = !min;min ? mainnav.addClass('affix') : mainnav.removeClass('min-mainnav');
//force reflow
mainnav[0].offsetWidth;
mainnav.prevAll('.hplace').remove();if(min){
$('<div class="hplace clearfix"></div>').insertBefore(mainnav).css('height', mainnav.outerHeight(true));
mainnav.addClass('min-mainnav');
} else {
mainnav.removeClass('affix');
}
}
})
}})();
and now looks perfect http://www.gamebreeze.net
Thank you TomC for helping me with this 🙂 ( can you edit topic name to navbar fixed for the top after scroll )
1 user says Thank You to costabreeze for this useful post
-
AuthorPosts
This topic contains 11 replies, has 3 voices, and was last updated by TomC 10 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum