Metro-UI-CSS icon indicating copy to clipboard operation
Metro-UI-CSS copied to clipboard

Cannot get Metro UI navigation bar dropdown to work

Open vkurpad opened this issue 12 years ago • 31 comments

I'm having trouble getting the navigation bar to work. I'm using Jquery ver 2.1.1. I've validated that jquery is working (added a little alert for window load). The navigation bar itself is rendering, but the dropdown just does not work. I'm using Visual Studio and installed the package via nuget.

JS Files included: metro.min.js jquery-2.1.1.js

CSS Files: metro-bootstrap.css metro-bootstrap-responsive.css

Please help.

vkurpad avatar Jul 02 '14 13:07 vkurpad

<li> <a class="dropdown-toggle" href="#">Products</a> <ul class="dropdown-menu" data-role="dropdown"> <li><a href="#">Windows 8</a></li> <li><a href="#">Skype</a></li> <li><a href="#">Internet Explorer</a></li> <li><a href="#">Office</a></li> </ul> </li>

olton avatar Jul 11 '14 21:07 olton

Sergey, Thanks for the response. I was not specific enough on my question. I have the template working for the most part, its only the dropdown that does not show up. I have the HTML snippet you shared included on the nav bar, but on the mouse over or click the drop down menu does not show. Please look at http://photoburst-dev.azurewebsites.net/ as an example of the problem I describe. I have your HTML snippet on the menu, but the drop down still does not show.

vkurpad avatar Jul 12 '14 03:07 vkurpad

I also have this problem. I have copied the code from the docs into my html. Strange thing is that the examples in docs folder works fine, but even if I include the same minified js, still doesn't work. Any thought?

ratones avatar Jul 14 '14 04:07 ratones

Well, the dilema it's solved. In the docs examples, there is a function called "reinit" in docs.js file. This function calls $.Metro.initDropdowns(). If I comment this, the examples also stop working. As a workaround, I added this call in my page and it works. I'm not sure this is a bug or it's just the way it should be...

ratones avatar Jul 14 '14 05:07 ratones

Thanks @ratones . I need to give it a try.

vkurpad avatar Jul 15 '14 17:07 vkurpad

am having the same problem. drop downs dont work and the navbar dropdown on small view port is not working too. files added are

        <script src="js/docs.js"></script>
        <script src="min/metro.min.js"></script>

bruno4eva avatar Sep 20 '14 13:09 bruno4eva

Same problem. The code in docs dosen't work !

native93 avatar Oct 03 '14 09:10 native93

I once uncounted the same problem and this is how i solved it. From the docs folder after you have download the package, maintain the main folder directory( js,css,fonts) and use the structure in this example " template-any.html "... It will work jux fine. http://afrawoma.a78.org is ma current site am working on.

bruno4eva avatar Oct 03 '14 11:10 bruno4eva

please read this http://metroui.org.ua/requirements.html

olton avatar Oct 03 '14 12:10 olton

Hey, thanks for the response. I used this order but still coudn't get through this. :/

            <link rel="stylesheet" href="css/metro-bootstrap.css" >
            <link rel="stylesheet" href="css/bootstrap.min.css">
            <link rel="stylesheet" href="css/metro-bootstrap-responsive.css">
            <link rel="stylesheet" href="min/iconFont.min.css" >
            <link rel="stylesheet" href="css/docs.css" >

            <script src="js/jquery-2.1.1.min.js"></script>
            <script src="js/jquery.widget.min.js"></script>
            <script src="js/jquery.mousewheel.js"></script>
            <script src="min/metro.min.js"></script>

native93 avatar Oct 03 '14 15:10 native93

Do you have a sample page to look at?

samscudder avatar Oct 03 '14 15:10 samscudder

Sample page please

olton avatar Oct 03 '14 15:10 olton

How can the tiles be made responsive

--- Original Message ---

From: "Sergey Pimenov" [email protected] Sent: October 3, 2014 12:06 PM To: "olton/Metro-UI-CSS" [email protected] Cc: "bruno4eva" [email protected] Subject: Re: [Metro-UI-CSS] Cannot get Metro UI navigation bar dropdown to work (#574)

please read this http://metroui.org.ua/requirements.html


Reply to this email directly or view it on GitHub: https://github.com/olton/Metro-UI-CSS/issues/574#issuecomment-57785313

bruno4eva avatar Oct 07 '14 09:10 bruno4eva

No idea why Drop-down is not working.

I included

script('js/jquery-2.1.1.min.js') script('js/jquery-ui.min.js') script('/js/jquery.widget.min.js')

style('css/jquery-ui.css') style('css/jquery-ui.theme.css')

style('css/metro-bootstrap.min.css') style('css/metro-bootstrap-responsive.min.css') style('css/iconFont.min.css') script('/js/metro.min.js') script('/js/metro-calendar.js') script('/js/metro-datepicker.js') script('/js/metro-dropdown.js')

ketan-chawda avatar Dec 05 '14 18:12 ketan-chawda

metro.min.js includes all js metro components. Check your main container for class metro. If your build dropdown from ajax, set global variable METRO_AUTO_REINIT to true

olton avatar Dec 05 '14 19:12 olton

Yes, my Body tag have metro class. Also should I comment-out metro-dropdown.js now?

body class="metro

div class="container" .... ....

nav class="sidebar dark"

  • Summary
  • <li class="stick bg-grey">
        <a class="dropdown-toggle" href="#"><i class="icon-tree-view"></i>Project</a>
        <ul class="dropdown-menu" data-role="dropdown">
            <li><a href>(Report-1)</a></li>
            <li><a href>(Report-2)</a></li>
       </ul>
    </li>
    
    </ul>
    

    /nav

    ... ....

    ketan-chawda avatar Dec 05 '14 19:12 ketan-chawda

js debug please

olton avatar Dec 05 '14 20:12 olton

Hi no error on console.

In short it is not toggling. It should do "style="display: block;" and "style="display: none;"

So I think the fact is, it is not able to apply JS to that element which is