add hide/show menu button

add hide/show menu button

by fares arjoun -
Number of replies: 2

Hello,

i want to add a button, in the block-region-content. it will appear when u log in with ur phone or when the pixel are too small and it will open the navigation when you click on it.

the problem there is no index.html

please how its possible to add this class on moodle? 


  • in index.html

    <div class="cont" onclick="myFunction(this)">

       <div class="bar1"></div>

       <div class="bar2"></div>

       <div class="bar3"></div>

   </div>

  • in scrtipt.js

function myFunction(x) {

    x.classList.toggle("change");

}


    .cont {

        padding:20px;

        float:left;

        display:inline-block;

        box-shadow:0px 1px 1px rgba(0,0,0,0.15);

        border-radius:3px;

        text-shadow:0px 1px 0px rgba(0,0,0,0.5);

        color:#777;

        font-size:20px;

        transition:color linear 0.15s;

       

    }


    .cont:hover, .toggle-nav.active {

        text-decoration:none;

        color:#66a992;

    }


Thank you

Average of ratings: -
In reply to fares arjoun

Re: add hide/show menu button

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The way to do something like this in Moodle would probably be to create a theme based on the one you're currently using, then adds your HTML in a renderer override or template and has the css in a stylesheet within the theme.

You might find the Themes Forum a useful place to ask for help with this.