I want to add expand & collapse functionality in the tree view list..how to add this?
I have added the jqueries required. . .
<div id="sidetree">
<div class="company">Company</div>
<div id="sidetreecontrol" class="sidetreecontrol"></div>
<ul class="treeview" id="tree">
<li>Home</li>
<li class="expandable">
<div class="hitarea expandable-hitarea"></div>
<span><strong>About Us</strong></span>
<ul style="display: none;">
<li>Our Offers</li>
<li class="last">Our Offers</li>
</ul>
</li>
</ul>
</div>
I think adding
Collapse All | Expand All
should do the trick.
Related
I'm relatively new to web development, and I'm using Materialize for the project I'm working on right now. My navbar code is attached, for some reason I can click on and follow the links in the sidebar, but not in the nav-content tabs. When I take out the tabs tabs-transparent classes in the ul, it works, but it looks ugly. I am loading JQuery- that was the only resolution I saw to this problem when I googled.
<nav class="blue-grey lighten-1 nav-extended" role="navigation">
<div class="nav-wrapper">
<a id="logo-container" href="#" class="brand-logo center"><img src="/application/static/application/colorondarknotext.png" height=60px/></a>
<ul class="right hide-on-med-and-down">
<li><a class="dropdown-button" href="#!" data-activates="dropdown1">Welcome, (USERNAME)!<i class="material-icons right">arrow_drop_down</i></a></li>
</ul>
<ul id="nav-mobile" class="side-nav">
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li>
<a class="collapsible-header">Welcome, (USERNAME)!<i class="material-icons right">arrow_drop_down</i></a>
<div class="collapsible-body">
<ul>
<li>Account Info</li>
<li>Log Out</li>
</ul>
</div>
</li>
</ul>
</li>
<li>
<div class="divider"></div>
</li>
<li>Application</li>
<li>Decisions</li>
<li>Travel Information</li>
</ul>
<i class="material-icons">menu</i>
</div>
<div class="nav-content hide-on-med-and-down">
<ul class="tabs tabs-transparent">
<li class="tab">Application</li>
<li class="tab">Decisions</li>
<li class="tab">Travel Information</li>
</ul>
</div>
</nav>
I've run into a series of issues like this.
Generally you need to look deeper in the docs. In this case the navbar component docs don't address the issue in their example code. You need to look under javascript>tabs section of the docs to uncover more details about how the tabs work.
http://materializecss.com/tabs.html#external
By default, Materialize tabs will ignore their default anchor behaviour. To force a tab to behave as a regular hyperlink, just specify the target property of that link!
The normal anchor (<a>) functionality is disabled/ignored. In order to make your links work like "normal" you need to add a target attribute to your links.
Assuming you want to open the links in the same window, you would add target="_self" to each <a> tag.
<li class="tab">Application</li>
<li class="tab">Decisions</li>
<li class="tab">Travel Information</li>
I've been trying to make a fluid drop-down menu like the on in udemy(https://i.imgur.com/nrorrMo.png) but the options inside my drop-down doesn't appear. Is there is anything i'm doing wrong?
<ul class="nav navbar-nav">
<li class="dropdown">
Heading 1
<div class="dropdown-menu multi-column" style="width: 100%;">
<div class="row">
<div class="col-md-4">
<ul class="dropdown-menu">
<li>Opt 1</li>
<li> Opt 2</li>
</ul>
</div>
</div>
</li>
</ul>
Your error comes with the use of the class="dropdown-menu" on the UL tag inside of the div.dropdown-menu. If you remove that class, you will see the content inside the dropdown.
Dear all i am beginners in Foundation and i am stuck in my code in medium device...i need your suggestion so that i can find my mistake:-below is my code:-
<div class="row">
<div class="large-6 medium-6 small-8 columns">
<ul class="dropdown menu" data-dropdown-menu>
<li class=" " id="logo"><img src="img/home/logo/logo.png"></li>
<li class=" ">Home - Payment Result - contact information</li>
</ul>
</div>
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium" >
<a id="nav-toggle" href="#" title="Navigation" data-toggle><span></span></a>
<!-- <button class="menu-icon" type="button" data-toggle></button>
<div class="title-bar-title"></div>-->
</div>
<div class="top-bar" id="main-menu" >
<div class="top-bar-right large-5 medium-6 small-4 columns" >
<ul class="menu" data-responsive-menu="drilldown medium-dropdown">
<li>How does it work</li>
<li>My order</li>
<li><span class="icon-cart"></span></li>
<li class="has-submenu">
<span class="icon-face"></span>
<ul class="submenu menu vertical" data-submenu>
<li>Pistachios</li>
<li>Pistachios</li>
<li>Pistachios</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
[please click on screenshot]
enter image description here
Your issue here is that the iPad is a large device and a medium device.
Zurb's documentation says:
Small: any screen.
Medium: any screen 640 pixels or wider.
Large: any screen 1024 pixels or wider.
The iPad's 'CSS resolution' (what the media queries work to) is 1024px x 768px, despite an actual resolution of 2048px x 1536px for the later versions.
So portrait is medium and landscape is large.
So in your above code medium-* will NOT be the visible structure on the iPad and .title-bar WILL, in landscape and vice versa in portrait. So you either have to:
If you're using CSS; create a new breakpoint for the iPad (this is a good resource:
CSS-Tricks - device media queries)
Or, if you're using SASS, you can reuse the mixin in the standard
Foundation SASS package to create specific CSS in a similar way to (1):
#media screen and #{breakpoint(768px)} and #{breakpoint(1024px down)} {
//iPad CSS here
}
Treat it as a large & medium device and change your HTML
.top-bar isn't really part of the grid system either, you have .top-bar-left and .top-bar-right but I'm not sure how much you can control these with columns and rows.
So this might work for you (but it doesn't control the width of left and right sections):
<div class="row">
<div class="large-6 medium-6 small-8 columns end">
<ul class="dropdown menu" data-dropdown-menu>
<li class=" " id="logo">
<img src="img/home/logo/logo.png">
</li>
<li class=" ">Home - Payment Result - contact information</li>
</ul>
</div>
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium">
<a id="nav-toggle" href="#" title="Navigation" data-toggle><span></span></a>
<!-- <button class="menu-icon" type="button" data-toggle></button>
<div class="title-bar-title"></div>-->
</div>
<div class="top-bar" id="main-menu">
<div class="top-bar-left">
<p class="show-for-large-only">
ERROR
</p>
</div>
<div class="top-bar-right">
<ul class="menu" data-responsive-menu="drilldown medium-dropdown">
<li>How does it work</li>
<li>My order</li>
<li><span class="icon-cart"></span></li>
<li class="has-submenu">
<span class="icon-face"></span>
<ul class="submenu menu vertical" data-submenu>
<li>Pistachios</li>
<li>Pistachios</li>
<li>Pistachios</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
A JSfiddle of this code
What is the problem with this code below..
everything is working except menu drop down.
<div class="navbar">
<div class="navbar-inner" >
<div class="container">
<ul class="nav">
<li class="dropdown">
Services <b class="caret"></b>
<ul class="dropdown-menu">
<li>Web Design</li>
<li>Web development</li>
<li>Wordpress Theme development</li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li > Hello, <?php echo "Admin"; ?> </li>
</ul>
</div>
</div>
You are missing a at the bottom. Otherwise everything seems to be fine.
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');
});