-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dropdown in navigation #202
Comments
Yes. Just add the dropdown code into the navbar. We may add an example in the docs in the near future |
I have added this example to the docs in components -> navbar |
wonderful. thxx |
It's a bit wonky. Under Chrome, Firefox and Safari, if you click on the mdi-navigation-arrow-drop-down icon rather than the word, "Dropdown", it self-unselects before you can pick something. |
ah yes. is there a fix for this? |
Hmm not sure. We'll look into it soon |
So are you going to reopen this? - to keep it on the radar? |
Hey @victordeassis, |
Hey! thanks for the feedback, here is the code:
|
Yes! but when I open the page, the dropdown is already "pressed", my dropdown list is on the left side of the screen, and my dropdown button is unaligned with the navbar components. Like the first picture that I've posted. |
Can you also post your dropdown initialization code? Currently I am not able to replicate this behavior. |
Dogfalo, when you say "initialization" is the HTML itself? This code is inside BODY brackets: <!-- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li><a href="#!">one</a></li>
<li><a href="#!">two</a></li>
<li><a href="#!">three</a></li>
</ul>
<nav>
<div class="nav-wrapper">
<div class="col s12">
<a href="#!" class="brand-logo">Logo</a>
<a class="button-collapse" href="#" data-activates="nav-mobile"><i class="mdi-navigation-menu"></i></a>
<ul class="right side-nav">
<li><a href="sass.html">Sass</a></li>
<li><a href="components.html">Components</a></li>
<!-- Dropdown Trigger -->
<li><a class="dropdown-button" href="" data-activates='dropdown1'>Dropdown<i class="mdi-navigation-arrow-drop-down right"></i></a></li>
</ul>
</div>
</div>
</nav> |
The initialization is not running on the load page and simule the event "click"? |
@victordeassis you need adding this code on your body: $(document).ready(function(){
$('.dropdown-button').dropdown();
}); |
Niiice! Thanks a lot guys ;) it worked fine when I include the jQuery script. Where can I find these instrucions in the documentation website? |
http://materializecss.com/javascript.html at the bottom of the page have the initialization code =D |
Oh! Sorry for my lack of attention. Thanks again Marcos and Dogfalo, problem solved ;) |
This shall be closed :) nice work! |
I think the original issue is still outstanding ... Before @victoreassis's issue. Pls see earlier comments. |
How can I enable the onchange or onclick events ? Currently there is no way to call any other functions with .dropdown(). I just want to call an AJAX once an item is selected. Would really appreciate if one can reply here as soon as possible. |
@iamraju did you solve your question? |
The dropdown don't work for me. I use it with Meteor JS. This is my onRedered function:
The This is my LI tag
Nothing changes when i click on my link. I tried anything, any changes to make it work. Please help. |
@fteem Nope, I had to switch to something else to solve it. |
@DWboutin same for me i do everthing that is writing here but it didn't work for me. |
@DWboutin @ranska On meteor it seems ok. I have tested on a fresh simple meteor build with materialize@=0.97.0 @DWboutin I think you need to take the account-dropdown section out of the @ranska... any details? See below for a working meteor example.
|
I used the dropdown in my navigation bar, but two out of four is showing and here is my code in html for my navbar:
menu
here is all my css modifications: .slider{ and lastly my js:
); I have uploaded a demo at http://www.jalasem.com |
while implementing dropdown for mobile app using phonegap. dropdown-content is not closing on selecting any one dropdown content.i have used the same codes from materializecss dropdown codes. and i have initilized dropdown in my javascript file as $('.dropdown-button').dropdown(); |
Is there a way to design a navbar which includes an element with a dropdown?
The text was updated successfully, but these errors were encountered: