So I'm trying to make a custom login bar for my Xenforo website theme, I've created a custom navigationbar and am trying to add in the Login etc but when I do it I get this: http://i.imgur.com/oyau6b5.png
Can anyone help me make it so it's all on 1 line instead of 3 seperate lines? My website is www.royaltymc.net
Here is the actual bar code:
<div class="navTabs4">
<xen:if is="#uix_pageStyle==1">
<div class="pageWidth">
</xen:if>
<ul class="publicTabs navLeft">
<xen:if is="( #uix_navigationStickyLogo && #uix_stickyNavigation ) || #uix_navStyle == 2">
<li id="logo_small">
<a href="{$logoLink}">
<xen:if is="#uix_smallLogoPath">
<img src="#uix_smallLogoPath">
<xen:elseif is="#uix_logoText"/>
<h2 class="uix_textLogo"><xen:if is="#uix_logoTextIcon"><i class="uix_icon #uix_logoTextIcon"></i></xen:if><xen:if is="#uix_logoText">#uix_logoText</xen:if></h2>
<xen:else/>
<img src="#headerLogoPath" alt="{$xenOptions.boardTitle}" />
</xen:if>
</a>
</li>
</xen:if>
<!-- Shop -->
<xen:if is="#uix_loginTriggerPosition == 1">
<xen:include template="uix_loginTab" />
</xen:if>
<!-- extra tabs: middle -->
<xen:if is="{$extraTabs.middle}">
<xen:foreach loop="$extraTabs.middle" key="$extraTabId" value="$extraTab">
<xen:if is="{$extraTab.linksTemplate}">
<li class="navTab {$extraTabId} <xen:if is="#uix_removeTabLinks">{xen:if $extraTab.selected, 'selected'} Popup PopupControl PopupClosed<xen:else />{xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}</xen:if>">
NoPopupGadget</xen:if>"<xen:if is="!#uix_navDropdownArrows"> rel="Menu"</xen:if>>{$extraTab.title}<xen:if is="{$extraTab.counter}"><strong class="itemCount"><span class="Total">{$extraTab.counter}</span><span class="arrow"></span></strong></xen:if>
<div class="<xen:if is="#uix_removeTabLinks">Menu JsOnly tabMenu<xen:else />{xen:if {$extraTab.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}</xen:if> {$extraTabId}TabLinks">
{xen:if '{$extraTab.selected} && #uix_pageStyle == 1 && !#uix_removeTabLinks', '<div class="pageWidth">'}
<div class="primaryContent menuHeader">
<h3>{$extraTab.title}</h3>
<div class="muted">{xen:phrase quick_links}</div>
</div>
{xen:raw $extraTab.linksTemplate}
<xen:if is="{$extraTab.selected}"><xen:include template="uix_tabLinksSearch" /></xen:if>
{xen:if '{$extraTab.selected} && #uix_pageStyle == 1 && !#uix_removeTabLinks', '</div>'}
</div>
</li>
<xen:else />
<li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'PopupClosed'}">
NoPopupGadget</xen:if>"<xen:if is="!#uix_navDropdownArrows"> rel="Menu"</xen:if>>{$extraTab.title}<xen:if is="{$extraTab.counter}"><strong class="itemCount"><span class="Total">{$extraTab.counter}</span><span class="arrow"></span></strong></xen:if>
<xen:if is="!#uix_removeTabLinks"><xen:if is="{$extraTab.selected}"><div class="tabLinks"><xen:include template="uix_tabLinksSearch" /></div></xen:if></xen:if>
</li>
</xen:if>
</xen:foreach>
</xen:if>
</ul>
<xen:if is="{$uix_searchPosition} == 2">
<xen:include template="uix_searchMinimal" />
</xen:if>
<xen:if is="#uix_pageStyle==1"></div></xen:if>
</div>
Here is my HTML Login Bar Code: (Lot's of uncessary code, not sure which bits to take out)
<xen:if is="!{$visitor.user_id} && {$contentTemplate} != 'login' && {$contentTemplate} != 'login_with_error'">
<li class="navTab login{xen:if '#uix_loginTriggerStyle == 2', ' Popup PopupControl'} PopupClosed">
<xen:if is="#uix_loginTriggerStyle == 1"><label for="LoginControl"></xen:if>
<a href="{xen:link login}" class="navLink uix_dropdownDesktopMenu{xen:if '#uix_loginTriggerStyle == 2', ' NoPopupGadget'}{xen:if '#uix_loginTriggerStyle == 3', ' OverlayTrigger'}"{xen:if '#uix_loginTriggerStyle == 2', 'rel="Menu"'}>
<xen:if is="#uix_loginTriggerIcons"><i class="uix_icon uix_icon-signIn"></i> </xen:if>
<strong><b><font color="white">Login</font></b></strong>
</a>
<xen:if is="#uix_loginTriggerStyle == 1"></label></xen:if>
<xen:if is="#uix_loginTriggerStyle == 2">
<div class="Menu JsOnly tabMenu uix_fixIOSClick">
<div class="secondaryContent uix_loginForm">
<xen:include template="uix_loginForm" />
</div>
</div>
</xen:if>
</li>
<a> or </a>
<xen:if is="#uix_loginShowRegister && {$contentTemplate} != 'register_form'">
<li class="navTab register PopupClosed">
<a href="{xen:link register}" class="navLink">
<xen:if is="#uix_loginTriggerIcons"><i class="uix_icon uix_icon-register"></i> </xen:if>
<strong><font color="white"> Create a new account</font></strong>
</a>
</li>
</xen:if>
</xen:if>
Here is my code CSS for it:
NOTE: If you need any other code, don't hesitate to ask!
.navTabs4
{
#property "navTabs";
font-size: 14px;
color: #fff;
background-color: #00254F;
line-height: 37px;
text-align: center;
border-color: #uix_primaryBorder.border-color;
border-radius: #uix_globalLargeBorderRadius;
background-clip: content-box;
#property "/navTabs";
height: 40px;
}
Add this CSS code to your stylesheets:
.navTab { display: inline-block; }
If it doesn't work, try adding !important after the inline-block statement.
Related
I know if i put title="link name" into the anchor tag, the description or title shows up. But I only want it to show, when the navbar is collapsed.
In the html file I have a lot more links but to save space I opted to show the rest.
.html template
<nav class="navbar-default navbar-static-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav nav-sb metismenu" id="side-menu">
<li class="nav-header" style="padding-top: 0px; padding-bottom: 0px;">
<div (click)="handleClick($event)">
<div class="profile-element" style="text-align: center;">
<img alt="image" style="max-width: 100%; max-height: 60px; text-align: center;" src="assets/images/nieto.jpg">
</div>
<div class="logo-element" style="text-align: center; color: #384C65">
SMS
</div>
</div>
</li>
<li class="nav-item mt-3" [ngClass]="{active: activeRoute('ReleaseNotes')}">
<a class="nav-link" title="ReleaseNotes" [routerLink]="['/ReleaseNotes']" style="color:#faec4c;">
<fa-icon style="padding-right: 5px;" [icon]="faExclamationTriangle"></fa-icon><span class="nav-label"> Release notes</span>
</a>
</li>
<li class="nav-item" [ngClass]="{active: activeRoute('Dashboard')}">
<a class="nav-link" [routerLink]="['/Dashboard']" style="color:greenyellow;">
<fa-icon style="padding-right: 5px;" [icon]="faChartLine"></fa-icon><span class="nav-label"> Dashboard</span>
</a>
</li>
<li class="nav-item" [ngClass]="{active: activeRoute('Agreements')}" *ngIf="globals.userHasAgreementAccess()">
<a class="nav-link" [routerLink]="['/Agreements']"><fa-icon [icon]="faFileSignature"></fa-icon><span class="nav-label"> Agreements</span></a>
</li>
<li class="nav-item" [ngClass]="{active: activeRoute('Appointments')}">
<a class="nav-link" [routerLink]="['/Appointments']"><fa-icon [icon]="faUsersCog"></fa-icon><span class="nav-label"> Appointments</span></a>
</li>
<li class="nav-item" [ngClass]="{active: activeRoute('Attachments')}">
<a class="nav-link" [routerLink]="['/Attachments']"><fa-icon [icon]="faPaperclip"></fa-icon><span class="nav-label"> Attachments</span></a>
</li>
I also shortened the ts file by a couple of lines to save space to show relevant info.
.ts file
import { Component } from '#angular/core';
import {Router} from '#angular/router';
import { GlobalsService } from 'src/app/app.globals.service';
import { faUsersCog, faUser, faCalendarCheck, faChartLine, faAlignJustify,faToolbox, faFileInvoiceDollar, faFileSignature, faPaperclip, faShoppingCart, faExclamationTriangle, faBug} from '#fortawesome/free-solid-svg-icons';
declare var jQuery:any;
#Component({
selector: 'navigation',
templateUrl: 'navigation.template.html',
})
export class NavigationComponent {
faUsersCog=faUsersCog; faUser=faUser;faCalendarCheck=faCalendarCheck;faChartLine=faChartLine;faAlignJustify=faAlignJustify;faToolbox=faToolbox; faShoppingCart=faShoppingCart;
faFileInvoiceDollar=faFileInvoiceDollar;faFileSignature=faFileSignature; faPaperclip=faPaperclip; faExclamationTriangle=faExclamationTriangle; faBug=faBug;
constructor(public globals: GlobalsService,private router: Router) {}
ngAfterViewInit() {
jQuery('#side-menu').metisMenu();
if (jQuery("body").hasClass('fixed-sidebar')) {
jQuery('.sidebar-collapse').slimscroll({
height: '100%'
})
}
}
}
You can conditionally add attributes in Angular, so you could only add the title attribute when the sidebar is collapsed.
<a class="nav-link" [attr.title]="isSidebarCollapsed ? 'Release Notes' : null">
Release notes
</a>
isSidebarCollapsed is a variable that you'll need to create in the NavigationComponent that you will need to set to true when the sidebar is collapsed, and false otherwise.
I'm trying to have it so my forum statistics addon is moved to the right side of the forum instead of the bottom.
I've tried using a float as well positioning fix.
Below is the whole small portion of the addon for my forum.
<xen:require css="pe_forum_stats.css" />
<div class="nodeList sectionMain" id="peStatsContainer">
<div class="peStatsBody">
<div class="categoryStrip">
<div class="categoryText">
<h3 class="nodeTitle">{xen:phrase forum_statistics}</h3>
</div>
</div>
<div class="peStatsContent">
<div class="peStatsMembersOnline">
<xen:if is="{$onlineUsers.records}">
<xen:if is="{$visitor.user_id}">
<xen:if hascontent="true">
<div class="peFollowedOnline">
<h4 class="minorHeading">{xen:phrase people_you_follow}:</h4>
<ul class="followedOnline">
<xen:contentcheck>
<xen:foreach loop="$onlineUsers.records" value="$user">
<xen:if is="{$user.followed}">
<li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
</xen:if>
</xen:foreach>
</xen:contentcheck>
</ul>
</div>
<h4 class="minorHeading">{xen:phrase members}:</h4>
</xen:if>
</xen:if>
<ol class="listInline">
<xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
<xen:if is="{$i} <= {$onlineUsers.limit}">
<li>
<xen:if is="{$user.user_id}">
<a href="{xen:link members, $user}"
class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}"><xen:if is="{$xenOptions.peForumStatsRichUserName}">{xen:helper richUserName, $user}<xen:else />{$user.username}</xen:if></a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
<xen:else />
{xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</xen:if>
</li>
</xen:if>
</xen:foreach>
<xen:if is="{$onlineUsers.recordsUnseen}">
<li class="moreLink">... {xen:phrase and_x_more, 'count={xen:number $onlineUsers.recordsUnseen}'}</li>
</xen:if>
</ol>
</xen:if>
<!-- <br /> Eh? -->
<div class="footnote">
{xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
</div>
</div>
<xen:if is="{$xenOptions.peForumStatsLegend}">
<ul class="peUserGroupLegend">
<xen:if hascontent="true">
<xen:contentcheck>
<xen:foreach loop="$peForumStatsLegend" value="$peForumStatsLegend">
<li>
<span class="peGroups" style="{$peForumStatsLegend.usergroup.username_css}" title="{$peForumStatsLegend.usergroup.user_title}">{$peForumStatsLegend.usergroup.title}<span class="divider">|</span></span>
</li>
</xen:foreach>
</xen:contentcheck>
</xen:if>
</ul>
</xen:if>
</div>
<div id="peForumStats">
<ul class="sectionFooter peList_inline">
<li>{xen:phrase discussions}:</li> <span class="value">{xen:number $boardTotals.discussions}</span>
<li>{xen:phrase messages}:</li> <span class="value">{xen:number $boardTotals.messages}</span>
<li>{xen:phrase members_count}:</li> <span class="value">{xen:number $boardTotals.users}</span>
<li>{xen:phrase latest_member}:</li> <span class="value"><xen:username user="$boardTotals.latestUser" /></span>
</ul>
</div>
</div>
</div>
I'm hoping to have it appear at the right side of the forum and when I scroll down for it to not move at all.
I am using akveo/ngx-admin theme for my project. And i need to customise sidebar menu icons. nebular came with eva icons but i need fontawesome icons.
tried to change "/node_modules/#nebular/theme/components/menu/menu-item.component.html"
but html changes not reflecting
<span *ngIf="menuItem.group">
<!-- <nb-icon class="menu-icon" [icon]="menuItem.icon" *ngIf="menuItem.icon"></nb-icon> -->
<i class="{{menuItem.icon}}"></i>
{{ menuItem.title }}
</span>
<a *ngIf="menuItem.link && !menuItem.url && !menuItem.children && !menuItem.group"
[routerLink]="menuItem.link"
[queryParams]="menuItem.queryParams"
[fragment]="menuItem.fragment"
[skipLocationChange]="menuItem.skipLocationChange"
[attr.target]="menuItem.target"
[attr.title]="menuItem.title"
[class.active]="menuItem.selected"
(mouseenter)="onHoverItem(menuItem)"
(click)="onItemClick(menuItem);">
<!-- <nb-icon class="menu-icon" [icon]="menuItem.icon" *ngIf="menuItem.icon"></nb-icon> -->
<i class="{{menuItem.icon}}"></i>
<span class="menu-title">{{ menuItem.title }}</span>
</a>
<a *ngIf="menuItem.url && !menuItem.children && !menuItem.link && !menuItem.group"
[attr.href]="menuItem.url"
[attr.target]="menuItem.target"
[attr.title]="menuItem.title"
[class.active]="menuItem.selected"
(mouseenter)="onHoverItem(menuItem)"
(click)="onSelectItem(menuItem)">
<!-- <nb-icon class="menu-icon" [icon]="menuItem.icon" *ngIf="menuItem.icon"></nb-icon> -->
<i class="{{menuItem.icon}}"></i>
<span class="menu-title">{{ menuItem.title }}</span>
</a>
<a *ngIf="!menuItem.children && !menuItem.link && !menuItem.url && !menuItem.group"
[attr.target]="menuItem.target"
[attr.title]="menuItem.title"
[class.active]="menuItem.selected"
(mouseenter)="onHoverItem(menuItem)"
(click)="$event.preventDefault(); onItemClick(menuItem);">
<!-- <nb-icon class="menu-icon" [icon]="menuItem.icon" *ngIf="menuItem.icon"></nb-icon> -->
<i class="{{menuItem.icon}}"></i>
<span class="menu-title">{{ menuItem.title }}</span>
</a>
<a *ngIf="menuItem.children"
(click)="$event.preventDefault(); onToggleSubMenu(menuItem);"
[attr.target]="menuItem.target"
[attr.title]="menuItem.title"
[class.active]="menuItem.selected"
(mouseenter)="onHoverItem(menuItem)"
href="#">
<!-- <nb-icon class="menu-icon" [icon]="menuItem.icon" *ngIf="menuItem.icon"></nb-icon> -->
<i class="{{menuItem.icon}}"></i>
<span class="menu-title">{{ menuItem.title }}</span>
<nb-icon class="expand-state" [icon]="getExpandStateIcon()" pack="nebular-essentials"></nb-icon>
</a>
<ul *ngIf="menuItem.children"
[class.collapsed]="!(menuItem.children && menuItem.expanded)"
[class.expanded]="menuItem.expanded"
[#toggle]="toggleState"
class="menu-items">
<ng-container *ngFor="let item of menuItem.children">
<li nbMenuItem *ngIf="!item.hidden"
[menuItem]="item"
[class.menu-group]="item.group"
(hoverItem)="onHoverItem($event)"
(toggleSubMenu)="onToggleSubMenu($event)"
(selectItem)="onSelectItem($event)"
(itemClick)="onItemClick($event)"
class="menu-item">
</li>
</ng-container>
</ul>
i have commented "nb-icon" and changed it with "i" tag to render fontawesome icon.
fontawesome free css is imported into angular.json and fontawesome icons are working properly in project. not sure what to do. anything would be helpful, thank you.
try adding font awesome to libraries using NbIconLibraries service like
constructor {
...
private icons: NbIconLibraries,
...
} {
this.icons.registerFontPack(...)
// or
this.icons.registerSvgPack(...)
}
you can install awesome fonts in your project and add the below code to your parent module which is PagesModule in below example
export class PagesModule {
constructor(iconsLibrary: NbIconLibraries){
iconsLibrary.registerFontPack('fa', { packClass: 'fa', iconClassPrefix: 'fa'
});
}
}
I am trying to implement a navbar for my application whose front end is built using Vue 2.0 and Bulma . It works well on desktops and but on smaller screens its showing the burger icon but it is not showing any elements. Its just present.
<template>
<div class="container is-fluid">
<div>
<nav class="navbar is-dark">
<div class="navbar-brand">
<a class="navbar-item" href="#">
<img alt="K R O N O S" height="100px">
</a>
<div class="button navbar-burger" data-target="navMenu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<div class="navbar-item">
<a class="" href="#"> Docs </a>
</div>
<div class="navbar-item ">
<a class="" href="#"> Report </a>
</div>
<div class="navbar-item">
<a class="">More</a>
</div>
<div class="navbar-item">
<a class="">Logout</a>
</div>
</div>
</div>
</nav>
</div>
</div>
</template>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Get all "navbar-burger" elements
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0)
// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {
// Add a click event on each of them
$navbarBurgers.forEach(function ($el) {
$el.addEventListener('click', function () {
// Get the target from the "data-target" attribute
var target = $el.dataset.target
var $target = document.getElementById(target)
// Toggle the class on both the "navbar-burger" and the "navbar-menu"
$el.classList.toggle('is-active')
$target.classList.toggle('is-active')
})
})
}
})
export default {
name: 'Navbar',
data () {
return {
msg: ''
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
div{
border: 0px solid black;
}
</style>
As you can see I have tried implementing the example code in on which was present here but with no use. Shouldnt Bulma give me responsive navbar out of the box. All the examples and solutions I have found are for the older "nav" class not the newer "navbar". Help would be much appreciated.
So, after a bit of studying the Vue guide and clues from fatman's comments, this is the fix I applied.
The above code works , but this is a more vue-ish way to do the navbar-burger menu.
<template>
<nav class="navbar">
<div class="container">
<div class="navbar-brand is-large">
<a class="navbar-item" href="#">
<img alt="K R O N O S" height="100px">
</a>
<button #click="makeBurger" class="button navbar-burger" data-target="navMenu" v-bind:class="{ 'is-active': activator }">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div class="navbar-menu" id="navMenu" v-bind:class="{ 'is-active': activator }">
<div class="navbar-end">
<div class="navbar-item">
<a class="" href="#"> Docs </a>
</div>
<div class="navbar-item ">
<a class="" href="#"> Report </a>
</div>
<div class="navbar-item">
<a class="">More</a>
</div>
<div class="navbar-item">
<a class="">Logout</a>
</div>
</div>
</div>
</div>
</nav>
</template>
<script>
export default {
name: 'Navbar',
data () {
return {
msg: '',
activator: false
}
},
methods: {
makeBurger () {
this.activator = !this.activator
return this.activator
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
div{
border: 0px solid black;
}
</style>
Hope this helps someone. The show/hide functionality is taken care by Bulma.
This works, but
will not close the menu
will cause router-links not to work
For 1.) I recommend adding #click to navbar-item as well:
<a #click="makeBurger" class="navbar-item">
<router-link to="/login">
{{link1}}
</router-link>
</a>
I am using Bootstrap's affix side-navigation. When you scroll down to the bottom of the element which the navigation refers to, the class .affix-bottom is applied to the navigation element and it should scroll (exactly in the way the side navigation in the Boostrap documentary works).
However, when the class changes to affix-bottom and the following styles are applied, the affix-navigation moves to the top of the page (and out of the viewport).
affix-bottom {
position: absolute;
top: auto;
bottom: 200px;
}
I am not sure wether the issue is related to Bootstrap. I have compared the styles Bootstrap natively uses and the styles I use and they are exactly the same.
This is the html I use:
<div class="row">
<div class="span3 bs-docs-sidebar" id="navfaq">
<ul class="nav nav-list bs-docs-sidenav affix-top">
<li class="">
<a onclick="scrollToAnchor('anchor1'); return false;" href="#anchor1">Go to anchor1</a>
</li>
<li class="">
<a onclick="scrollToAnchor('anchor2'); return false;" href="#anchor2">Go to anchor2</a>
</li>
<li class="">
<a onclick="scrollToAnchor('anchor3'); return false;" href="#anchor3">Go to anchor3</a>
</li>
<li class="">
<a onclick="scrollToAnchor('anchor4'); return false;" href="#anchor4">Go to anchor4</a>
</li>
<li class="">
<a onclick="scrollToAnchor('anchor5'); return false;" href="#anchor5">Go to anchor5</a>
</li>
<li class="active">
<a onclick="scrollToAnchor('anchor6'); return false;" href="#anchor6">Go to anchor6</a>
</li>
<li>
<a>
<button class="btn pull-center">Contact</button>
<button class="btn pull-center">Call</button>
<p class="caption">on weekdays</p>
</a>
</li>
</ul>
</div>
<div class="span9">
...
</div>
As Bootstrap's Affix is having some issues, I wrote my own script which changes the classes of the affix from .affix-top to .affix when you scroll further than the top-position of the .row element and when you scroll to the bottom of the .row element, it will add the class .affix-bottom.
$(document).ready(function() {
$(window).scroll(function(){
if( $('.nav.nav-list.bs-docs-sidenav').height() >= (($('#anchor1').offset().top + $('.row .span9').height() - $('.navbar').height() - $(window).scrollTop() - 40 ) ) ) {
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix');
$('.nav.nav-list.bs-docs-sidenav').addClass('affix-bottom');
}
else {
$('.nav.nav-list.bs-docs-sidenav').addClass('affix');
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix-bottom');
if( $(window).scrollTop() >= (($('#anchor1').offset().top) - ($('.navbar').height()) - 20)) {
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix-top');
$('.nav.nav-list.bs-docs-sidenav').addClass('affix');
}
else if( $(window).scrollTop() < (($('#anchor1').offset().top) - ($('.navbar').height()) - 20)) {
$('.nav.nav-list.bs-docs-sidenav').addClass('affix-top');
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix');
}
}
});
});
This keept my up all night and any help would be greatly appreciated.
Edit: Ok, I finally fixed it. However, it's more of a workaround. I changed the JS to the following:
$(document).ready(function() {
$(window).scroll(function(){
if( $('.nav.nav-list.bs-docs-sidenav').height() >= (($('#allgemeine-fragen-zu-meinunterricht-de').offset().top + $('.row .span9').height() - $('.navbar').height() - $(window).scrollTop() - 40 ) ) ) {
$(".span3.bs-docs-sidebar").css({
'position': 'relative',
'height': $('.row .span9').height()
});
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix');
$('.nav.nav-list.bs-docs-sidenav').addClass('affix-bottom');
}
else {
$('.nav.nav-list.bs-docs-sidenav').addClass('affix');
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix-bottom');
if( $(window).scrollTop() >= (($('#allgemeine-fragen-zu-meinunterricht-de').offset().top) - ($('.navbar').height()) - 20)) {
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix-top');
$('.nav.nav-list.bs-docs-sidenav').addClass('affix');
}
else if( $(window).scrollTop() < (($('#allgemeine-fragen-zu-meinunterricht-de').offset().top) - ($('.navbar').height()) - 20)) {
$('.nav.nav-list.bs-docs-sidenav').addClass('affix-top');
$('.nav.nav-list.bs-docs-sidenav').removeClass('affix');
}
}
});
});
I have no idea why it's working in Bootstrap without the position:relativ and the equivalent height for the span3.
try this
just add class affix to div
<div class="span3 bs-docs-sidebar affix affix-top" id="navfaq">
<ul class="nav nav-list bs-docs-sidenav ">
<li class=""><a onclick="scrollToAnchor('anchor1'); return false;" href="#anchor1">Go
to anchor1</a> </li>
<li class=""><a onclick="scrollToAnchor('anchor2'); return false;" href="#anchor2">Go
to anchor2</a> </li>
<li class=""><a onclick="scrollToAnchor('anchor3'); return false;" href="#anchor3">Go
to anchor3</a> </li>
<li class=""><a onclick="scrollToAnchor('anchor4'); return false;" href="#anchor4">Go
to anchor4</a> </li>
<li class=""><a onclick="scrollToAnchor('anchor5'); return false;" href="#anchor5">Go
to anchor5</a> </li>
<li class="active"><a onclick="scrollToAnchor('anchor6'); return false;" href="#anchor6">
Go to anchor6</a> </li>
<li><a>
<button class="btn pull-center">
Contact</button>
<button class="btn pull-center">
Call</button>
<p class="caption">
on weekdays</p>
</a></li>
</ul>
</div>