This is taking too much, how to make a fixed menu when scrolling VERY EASY
edit the file: includes/templates/YOUR_TEMPLATE/templates/tpl_modules_categories_tabs.php
<!-- Under this line around line 31-->
<?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?>
<!-- ADD this script -->
Code:
<!-- TRYING ADD STATIC MENU -->
<script>
$(function() {
var header = $(".stuck-nav");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 170) {
header.addClass("fixedbar");
} else {
header.removeClass("fixedbar");
}
});
});
</script>
<!-- AND ADD THIS DIV TAG just after the script -->
Code:
<div class="stuck-nav">
<!-- Just above this line -->
<div id="navCatTabsWrapper">
<!-- and close the div just before the end of file -->
<?php } ?>
<!-- you will have something like this -->
Code:
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
?>
<?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?>
<!-- TRYING ADD STATIC MENU -->
<script>
$(function() {
var header = $(".stuck-nav");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 170) {
header.addClass("fixedbar");
} else {
header.removeClass("fixedbar");
}
});
});
</script>
<div class="stuck-nav">
<div id="navCatTabsWrapper">
<div id="navCatTabs">
<ul><?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
<li><?php echo $links_list[$i];?></li>
<?php } ?>
</ul>
</div>
</div>
</div>
<?php } ?>
<!-- EOF -->
After edit tpl_modules_categories_tabs.php EDIT or CREAT includes/templates/YOUR_TEMPLATE/css
stylesheet_custon.css
ADD this:
Code:
/* stuck */
@media (min-width: 1025px){.stuck-nav > div{position: relative;}}
.fixedbarCSs{top: -250px;opacity: 0;-webkit-transition: all 500ms ease-out 0s;-moz-transition: all 500ms ease-out 0s;-ms-transition: all 500ms ease-out 0s;-o-transition: all 500ms ease-out 0s;transition: all 500ms ease-out 0s;}
.fixedbar{position: fixed !important;top: 0;left: 0;width: 100%;opacity: 1;z-index: 7111111;background-color: #fff;box-shadow: 0 1px 3px rgba(0, 0, 0, 1.12), 0 1px 2px rgba(0, 0, 0, 0.24);-webkit-transition: opacity 500ms ease-out 0s;-moz-transition: opacity 500ms ease-out 0s;-ms-transition: opacity 500ms ease-out 0s;-o-transition: opacity 500ms ease-out 0s;transition: opacity 500ms ease-out 0s;}
.fixedbar .cart{top: 6px;position: relative;}
.fixedbar .badge--cart{right: 0;top: -33px;}
.fixedbar .dropdown.text-right{margin-right: 10px;padding: 0 30px 10px 0;}
.fixedbar1{position: absolute!important;top: 0;left: 0;}
@media (min-width: 1025px){.fixedbar{min-height: 50px;}
.fixedbar .search, .fixedbar .account{display: none !important;}
.fixedbar .offset-top-5{margin-top: 0 !important;}
.fixedbar .cart{top: 4px;}
.fixedbar .cart .icon{margin-right: 3px;}
.fixedbar .badge--cart{right: 0;top: -23px;}
.fixedbar #mainMenu{padding-top: 4px;}
.fixedbar #mainMenu .navbar-nav > li > a .act-underline{padding-bottom: 7px;}
.fixedbar .dropdown.text-right{margin-right: 0px;}}
@media (max-width: 1024px){.fixedbar .account, .fixedbar .search{display: none !important;}
.fixedbar .offset-top-5{margin-top: 0 !important;}
.fixedbar .cart{right: 17px !important;margin-top: -26px !important;}
.fixedbar .cart .dropdown > a .icon{color: #fff !important;font-size: 2em !important;}
.fixedbar .badge--cart{width: 28px;height: 28px;line-height: 1.6em;top: -20px;right: -30px !important;}
.fixedbar .dropdown.text-right{padding-right: 25px;}
#header .fixedbar .container:first-child .row{padding-top: 0;}}
/* /stuck */
VOILÁ - THATS ALL - See it in complementosparati.com scroll dow the page to see the FIXED MENU
Bookmarks