Giter VIP home page Giter VIP logo

Comments (5)

onokumus avatar onokumus commented on May 25, 2024

@robov
Yes of course. Add the following code.

CSS

@media (min-width:768px) {
   #menu li {
      position: relative;
   }
   #menu > li ul {
      position: absolute;
      left: 100%;
      top: 0;
      min-width: 200px;
      display: none;
   }
   #menu li:hover > ul,
   #menu li:hover > ul.collapse {
      display: block !important;
      height: auto !important;
      z-index: 1000;
      background: #444;
   }
}

JS

(function($) {
  $(document).ready(function() {  
    var $this = $('#menu'), resizeTimer, self = this;    
    var initCollapse = function(el) {
      if ($(window).width() >= 768) {
        this.find('li').has('ul').children('a').off('click');
      }
    }
    $(window).resize(function() {
        clearTimeout(resizeTimer);
        resizeTimer = setTimeout(self.initCollapse($this), 250);
    });    
  });
})(jQuery);

DEMO

Mozilla Thimble

from metismenu.

robov avatar robov commented on May 25, 2024

Thanks... works brilliant...
Can you please point me out what styles to override to change the hover background colors. I cannot seem to find the right ones.

from metismenu.

onokumus avatar onokumus commented on May 25, 2024

@robov
According to the demo.css file you can customize yourself.

from metismenu.

robov avatar robov commented on May 25, 2024

Can I make the parent clickable (that expands automatically with its children)
Now the parent is not clickable.
I know it then will not work for a small screen, but that is fine for this other project.
How can I make the parent clickable ?

from metismenu.

onokumus avatar onokumus commented on May 25, 2024

@robov , @lorvent
https://gist.github.com/onokumus/9dec78937e795ba3c138

from metismenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.