Sidenav button-collapse disappears in materialize - materialize

I have made a sidenav and its collapse button is in the navbar using the materialize framework. The collapse-button starts disappering if the screen resolution is more than 993px. This is the code
<div class="nav-wrapper">
<ul id="slide-out" class="side-nav">
<li>First Sidebar Link</li>
<li>Second Sidebar Link</li>
</ul>
<i class="mdi-navigation-menu"></i>
<img src="Logo.png" width="120">
<ul id="nav-mobile" class="right">
<li>
<img src="work/marker-5.png">Bangkok
</li>
</ul>
</div>
</nav>
My script is this
$(".button-collapse").sideNav({
menuWidth: 350,
closeOnClick: true
});
Is this due to any media query in the materialize framework?

If you remove the button-collapse class then the menu will remain visible on wider screens.

That it's because the materialize only use this button for phones and tablets. If you want to use it for large devise you need to add the following class to your menu item like they said in their documentation
Fullscreen HTML Structure
If you want the menu to be accessible on all screensizes you just have to add a simple helper class show-on-large to the .button-collapse
When you do it, the code will remain in this way.
<i class="mdi-navigation-menu show-on-large"></i>
also i actually change the class from "mdi-navigation-menu" to "material-icons" and use the menu icon. In this case the code is going to look like this:
<i class="material-icons show-on-large">menu</i>
This is the link of the Materialize Documentation
Hope this help you! :) In my personal opinion materializeCSS need more specific documentation for certain things.

In you materialize.css file , change the following code,
#media only screen and (min-width: 993px) {
nav a.button-collapse {
display: none;
}
}
To
#media only screen and (min-width: 993px) {
nav a.button-collapse {
display: block;
}
}

Related

How do I scope nuxt-link-exact-active only for particular page in nuxt?

I am creating a side menu bar, and I want to highlight name of page user is currently active on. Something like this:
I have successfully managed to do that, but style I defined is taking effect on all the links throughout the website, which is causing a lot of problem.
If I apply <style scoped>, style is not taking effect anywhere. Not even on intended page.
My Component looks something like this..
Menubar.vue
<template>
<ul class="w-56 border bg-base-100 border-none">
<li class="my-4">
<nuxt-link active-class="current-dash-page" to="./general" class="nav-link p-3">General Information</nuxt-link>
</li>
<li class="my-6">
<nuxt-link to="./announcements" class="p-3">Announcements</nuxt-link>
</li>
<li class="my-6">
<nuxt-link to="./learners" class="p-3">Manage Learners</nuxt-link>
</li>
<li class="my-6">
<nuxt-link to="./schedule" class="p-3">Schedule</nuxt-link>
</li>
<li class="my-6">
<nuxt-link to="./danger" class="p-3">Danger Zone</nuxt-link>
</li>
</ul>
</template>
<style>
.nuxt-link-exact-active {
border-radius: 0.5rem;
--tw-bg-opacity: 1;
--tw-text-opacity: 1;
background-color: hsla(var(--a) / var(--tw-bg-opacity));
color: white;
}
</style>
The problem might be with the values of your to="" arguments. They are relative to the current page, so if you navigate to, for example, "learners" then your url will end with .../learners/ then if you navigate to "danger" your url will change to .../learners/danger/ which will be missed by the exact-active class. Try giving absolute values to to="".
The css class you should be using is router-link-exact-active

change active tab on document ready

I would like to change the active pill/tab on document load. I know you can set the active pill like I have below but for other reasons I want to change it after document load. I have tried various bits of JS but nothing seems to work. Here's the HTML and JS (I have also tried replacing data-toggle="pill" with data-toggle="tab" below and still doesn't work).
<div>
<ul class="nav nav-pills pillstyle">
<li class="active tabstyle"><a data-toggle="pill" href="#apple">Apple</a></li>
<li class="tabstyle"><a data-toggle="pill" href="#banana">Banana</a></li>
<li class="tabstyle"><a data-toggle="pill" href="#pear">Pear</a></li>
<li class="tabstyle"><a data-toggle="pill" href="#orange" >Orange</a></li>
</ul>
</div> <!-- nav pills close -->
<div class="tab-content">
<div id="apple" class="tab-pane fade in active"> `
.... content of tabs.
JS
$(document).ready(function(){
$('#banana').tab('show');
});
or
$(document).ready(function(){
$('#banana').pill('show');
});
You just need to change your jQuery selector to address the a element instead of the tab-pane div.
$(document).ready(function(){
$('a[href="#banana"]').tab('show');
});
If you need, you can find more detailed description about bootstrap tabs in the official documentation.
#Stu Here you go.
HTML:
Assign an ID myTab to UL element.
<ul class="nav nav-pills pillstyle" id="myTab">
JS:
$(function () {
$('#myTab a[href="#banana"]').tab('show');
});
Also refer to Bootstrap documentation on selecting different elements on load here. It will give you better understanding.
http://getbootstrap.com/2.3.2/javascript.html#tabs
Working demo: https://jsfiddle.net/tf9k9j27/
Note: Just to answer your trial and error.
You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling. (From bootstrap docs. read more to get better clarity)

How to remove the little bullets/circles at the top of Foundation's Orbit Content Slider?

In Zurb Foundation's Orbit Content Slider, how can I remove the little bullets/circles at the top that represent how many slides you have (and are also clickable)? I want them gone.
There is no bullets/circles at the top in zurb-foundation 5.
So I assume you are using this type of orbit.
How about try .orbit-bullets {display: none;}, somewhere in your css file?
You can use the data-options attribute in your ul:
<ul data-orbit data-options="bullets:false;">
<li>
<img src="satelite-orbit.jpg" alt="slide 1" />
</li>
<li>
<img src="andromeda-orbit.jpg" alt="slide 2" />
</li>
<li>
<img src="launch-orbit.jpg" alt="slide 3" />
</li>
</ul>
You can also use Javascript:
$(document).foundation({
orbit: {
timer_speed: 1000,
bullets: false
}
});
Foundation 5 has more documentation toward the bottom of the Orbit page.
It shouldn't matter which version of Foundation you are using. As mentioned in the above answer; setting orbit-bullets to display none should work.
example:
.orbit-bullets { display: none; }
You could also try the following:
.orbit-bullets-container { display: none; }
If neither of these declarations are working I would guess that the issue lies within your CSS. It would appear that you have either set orbit-bullets to display block somewhere in your stylesheet after you have set them to display none, possibly within a parent div; or you are calling your stylesheet before foundation's CSS and it's being overridden after your declaration. When using any framework, you should call those styles and scripts first; before your application files.
If you could provide an example it shouldn't be difficult to resolve.

collapse search bar to icon in Boot strap 3

I am creating a responsive layout in Boot Strap 3.
I am not able to fix the collapsible search bar. Please click on below link to view the how collapsible menu should look.
Expanded Menu Link
Collapsible Menu Link
Please advise.
Thank you
You should change your code a little bit to make it work on mobile device.
Change this
<a href="#"><img src="images/iconCart.png" width="14" height="13">
Cart <span class="badge">2</span></a>
To this
<a href="#">
<span class="show-mobile"><img src="images/iconCart.png" width="14" height="13"> </span>
<span class="hidden-mobile">Cart</span>
<span class="badge hidden-mobile">2</span>
</a>
And add media Query CSS like
#media screen and (max-width: 768px) {
.show-mobile {
display:inline-block;
}
.hidden-mobile {
display:none;
}
}

Tabstrip containing bootstrap columns

I have a Kendo tabstrip and I'm trying to put two divs with the col-md-6 class side by side inside a tabstrip item. Instead of having 2 columns, they stack on top of each other. If I change any of them to col-md-5 or smaller, they work correctly. Has anyone had this problem and found the culprit?
This might be more of a 'hack' than a fix, but this is how we got around it
create a class, lets call it boxFix
.boxFix *,
.boxFix *::before,
.boxFix *::after {
-moz-box-sizing: border-box !important;
-webkit-box-sizing: border-box !important;
box-sizing: border-box !important;
}
Then for the kendo tab strip
<div id="tabstrip">
<ul>
<li class="k-state-active">
tab 1
</li>
<li>
tab 2
</li>
<li>
tab 3
</li>
Sydney
</li>
</ul>
<div>
<div class="boxFix">
<!--bootstrap grids work again-->
</div>
</div>
<div>
<div class="boxFix">
<!--bootstrap grids work again-->
</div>
</div>
<div>
<div class="boxFix">
<!--bootstrap grids work again-->
</div>
</div>
Like I said this is probably more of a hack... but I hope it helps.
I was experiencing the same issue as OP; however, I am using the Telerik MVC wrappers which already place a k-content class on the tab contents div. Therefore, I implemented Josh's suggestion by reusing the Telerik / Bootstrap classes instead of creating a new class.
.k-content > .row > *,
.k-content > .row > *::before,
.k-content > .row > *::after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
I had the same problem and solved it using http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-twitter-bootstrap#nest-widgets-and-bootstrap-grid-layout
Here is a working sample
http://dojo.telerik.com/#Xavier/iYAW/2