Foundation 5: sticky Nav for Mobile - html

I have a simple one page site. Im using the "top-bar" wrapped in a "fixed" div, which works fine on every size but mobile. On mobile the nav is in fact fixed until the menu icon is clicked/tapped. then it opens the menu at the top of the page and nav is no longer fixed.
Here is my code:
<div class="fixed">
<nav class="top-bar" data-topbar>
<ul class="title-area">
<!-- Title Area -->
<li class="name">
<h1>
Page Title
</h1>
</li>
<li class="toggle-topbar menu-icon"></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="divider"></li>
<li>Process</li>
<li class="divider"></li>
<li>Bookshelf</li>
<li class="divider"></li>
<li>Brands</li>
<li class="divider"></li>
<li>Looking for</li>
<li class="divider"></li>
<li>Contact</li>
</ul>
</li>
</ul>
</section>
</nav>
</div>
Thanks in advance.

Related

Zurb foundation drop down menu not works

I am starting to learn ember and try to incorporate some navigation bar using zurb foundation framework. I have a problem with dropdown menu. Check this link
<ul class="title-area">
<li class="name">
<h1>Home</h1>
</li>
<!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li class="has-dropdown">
{{#linkTo "about"}}About{{/linkTo}}
<ul class="vertical dropdown menu" data-dropdown-menu>
<li click>{{#linkTo "about.team"}}Team{{/linkTo}}</li>
</ul>
</li>
<li click>{{#linkTo "about.team"}}About/Team again{{/linkTo}}</li>
<li>{{#linkTo "contact"}}Contact{{/linkTo}}</li>
</ul>
</section>
I can not achive to trigger route when clicking on About/Team. When clicking on "About/Team again" then route works.
Any idea why this happens?

Navigation system goes a little weird when resizing browser

I am having a little problem with the navigation list items going a little below the top-bar when I resize the browser. When I remove the image it seems to be working perfectly fine on all screen resolutions but inserting the logo has had an affect on this. Is there any way I can solve this. Can't seem to find out what the problem is.
HTML:
<!-- HEADER START -->
<div id="header">
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name">
<h1>
<a href="index.html"><img src="img/flogo.svg" class="logo" alt="Logo">
Sharp <span>Media </span>
</a>
</h1>
</li>
</li>
<li class="toggle-topbar menu-icon"><span>menu</span></li>
</ul>
<section class="top-bar-section">
<ul class="right">
<li class="divider"></li>
<li class="has-dropdown">
<li>Home</li>
<ul class="dropdown">
</ul>
</li>
<li class="divider"></li>
<li>FAQs</li>
<li class="divider"></li>
<li class="has-dropdown">
<li>Contact Us</li>
<ul class="dropdown">
<li class="divider"></li>
</ul>
</li>
</ul>
</section>
</nav>

Foundation insert progress bar into top-bar

I use the framework Foundation 5, i use the top bar and i want to insert into the top-bar a simple progress bar
The only problem is the progross bar is not horizontal but vertically. It's really strange, i don't know how to correct that.
jsfiddle
<nav class="top-bar" data-topbar="">
<!-- Title -->
<ul class="title-area">
<li class="name"><h1>Sexy Top Bar</h1></li>
<!-- Mobile Menu Toggle -->
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<!-- Top Bar Section -->
<section class="top-bar-section">
<!-- Top Bar Right Nav Elements -->
<ul class="right">
<!-- progess bar bug -->
<li>
<div class="progress">
<span class="meter"></span>
</div>
</li>
<li class="divider"></li>
<!-- Anchor -->
<li>Generic Button</li>
<li class="divider"></li>
<!-- Button -->
<li class="has-form show-for-large-up">
Get Lucky
</li>
</ul>
</section></nav>
It's not vertical, it's just doesn't have width.
fix:
div.progress{
width: 500px;
}

Topbar not displaying responsive menu - foundation 5

I am currently working with foundation 5 and ultimately trying to make my page mobile friendly. I have a top navigation bar that I have created for the page following some of the basic structures. The navigation bar has problems being responsive. It does not display a menu at a all when I resize smaller the screen. How can I get the navigation bar to be responsive?
HTML:
<nav class="tab-bar show-for-small">
<a class="left-off-canvas-toggle menu-icon">
<span>Title</span>
</a>
</nav>
<nav class="top-bar docs-bar hide-for-small" data-topbar>
<ul class="title-area">
<li class="name">
<h1>
Title
</h1>
</li>
</ul>
<section class="top-bar-section">
<ul class="right">
<li class="divider"></li>
<li class="has-dropdown not-click">
<a class="" href="#">Test</a>
<ul class="dropdown">
<li>
SubTest
</li>
</ul>
</li>
<li class="divider"></li>
<li class="has-dropdown not-click">
<a class="" href="#">Test2</a>
<ul class="dropdown">
<li>
SubTest2
</li>
</ul>
</li>
<li class="divider"></li>
<li class="has-dropdown not-click">
<a class="" href="#">Test3</a>
<ul class="dropdown">
<li>
SubTest3
</li>
</ul>
</li>
</ul>
</section>
</nav>
You have given it the class .hide-for-small for the main one which holds all of the dropdowns.
Then the one that is viewable by mobile, you have no data inside of it.
Add the <a class="left-off-canvas-toggle menu-icon">
<span>Title</span>
</a> to the other nav.
Refer to this page here to get a proper responsive topbar.

Change PARENT class when child link is clicked to "active"

Right I have seen the following information on this topic so do understand more about is here is what I have read so far:
Removing/adding link class onclick
Changing an element's ID with jQuery
and I have read the obvious jquery UI page but I can't find the way to add the onclick so that it changes the "parent" element to class="active"
<!--navbar-->
<nav class="top-bar">
<ul class="title-area">
<!-- Title Area -->
<li class="name">
<h1><a href="#" >Relution.co.uk</a></h1>
</li>
<li class="toggle-topbar menu-icon">
<span>Menu</span>
</li>
</ul>
<section class="top-bar-section">
<!-- Left Nav Section -->
<ul class="left hide-for-medium-up">
<li class="has-form">Click Here to login</li>
<li class="has-form">Not a member? Register for free</li>
</ul>
<!-- Right Nav Section -->
<ul class="right">
<li class="divider"></li>
<li class="active">Home</li>
<li class="divider"></li>
<li>About</li>
<li class="divider"></li>
<li>Services</li>
<li class="divider"></li>
<li>Portfolio</li>
<li class="divider"></li>
<li>Contact</li>
<li class="divider"></li>
<li class="has-dropdown hide-for-small">
</i>
<ul class="dropdown">
<li><i class="foundicon-search"></i> Search</li>
</ul>
</li>
<li class="has-form hide-for-medium-up">
<form>
<div class="row collapse">
<div class="small-8 columns">
<input type="text">
</div>
<div class="small-4 columns">
Search
</div>
</div>
</form>
</li>
</ul>
</section>
</nav>
<!--/navbar-->
Below is the code that I'm using to target the links for an onlick even when I do this I want the parent li to become acive and all others to not be active
<script>
$(document).ready(function() {
$('nav.top-bar > section.top-bar-section > ul.right > li > a').click(function(){
http://jsfiddle.net/n5CLu/
$('nav.top-bar > section.top-bar-section > ul.right > li > a').click(function(e){
e.preventDefault();
$(this).parent().addClass('active').siblings().removeClass('active');
});