Animated dropdown menu

Dynamic multilevel menubar - easy (?) adaptation of colors and sizes - Also suitable for small screens (mobile).

Very simple display of a multilevel animated dropdown menu !

The plugin is suitable for small screens (mobile) !
The color themes and dimensions are modifiable, as explained in the last section below.

Introduction

Flexibility and simplicity are the main keywords for this menu displayer. See an example on our Repair Café website.
It uses (all ?) the potential of the various browsers : colour gradients, shadow for boxes and texts, as well as rounded corners, not to mention the dynamic menu boxes !

For smaller screens, the plugin reacts differently and displays a vertical drop down menu. The menu can also be discrete, disappearing at printing !

This animated dropdown menu is essentially based on a simple (!) style sheet (menu_anime.css). It does all the work !
This plugin is an ideal complement to the menus plugin but it is convenient for all menus containing a selector class="menu_anime".

The plugin is also designed to simplify the adjustment of colours and dimensions to each particular site. A method for doing it is described in detail at the end of this article.

The original idea of ​​this menu is linked to the work of Catalin Rosu. This plugin has originally been derived from his elegant and talented handling of style sheets.

Installation

Choose a manual or automatic method provided by SPIP. The plugin has no dependencies.

Use

The simplest and most general use of this plugin is through the plugin menus. After enabling this plugin (if not already), simply create a menu (or edit an existing menu) ensuring to assign the CSS class menu_anime as can be seen on the following screen-shot.

Here, the identifier « barrenav » causes the menu to display as the main navigation bar. No other intervention is necessary !

More generally, the plugin will display an entire list of links (of one or several levels) of which the first level contains the selector .menu_anime (ie <ul class="menu_anime">) and whose immediate parent belongs to the class .menu container (eg <div class="menu-container">).

Of course and as usual, the menu_anime.css stylesheet can be modified (by placing the modified copy in the squelettes/css/ directory). You certainly will be impatient to change the menu colours. However, direct intervention on the style sheet itself is particularly complex and daunting. That is why an alternative method has been developed (see below).

Changing colours and sizes

The plugin contains a file menu_anime.less allowing easy (?) adaptation to the specific characteristics of each website.
Although the process may seem a little daunting, it is infinitely easier than direct edition of the menu_anime.css style sheet.

Step by step procedure :

  1. Open the file menu_anime.less for editing. This file is contained in the package.
  2. In this file, change the colour ​​and/or size values as desired. They are at the beginning of the file.
  3. Compile the resulting file using a compiler Less compiler, eg online compiler.
  4. Create a menu_anime.css empty file and copy-paste the result of the compilation in it.
  5. Place the new file in the squelettes/css/ directory or replace the one located in the directory plugins/auto/menu_anime/css/.
  6. Carefully store your version of the file menu_anime.less so you can recover your settings for later updates.

Example : changing the base colour of the menu

  1. Select a new colour using an online color utility.
  2. Open the file menu_anime.less in a text editor.
  3. Replace the colour value (#b0422c) in the line @theme-basic: #b0422c; / * ... * / with the one that was chosen.
  4. Compile the content of this new file through an online compiler.
  5. Create a new empty file menu_anime.css and place the entire result of the compilation (copy and paste).
  6. Set the resulting file menu_anime.css in the squelettes/css/ your favourite SPIP. By the way, add your modified menu_anime.less file in the same directory (so you will not lose it).

Simple, isn’t it ?

Another solution would perhaps be to use the LESS CSS plugin. But I’m not sure it would give any advantage. Changing colours of a website menu is a very infrequent operation once it has been installed. To be discussed...

Discussion

Aucune discussion

Ajouter un commentaire

Avant de faire part d’un problème sur un plugin X, merci de lire ce qui suit :

  • Désactiver tous les plugins que vous ne voulez pas tester afin de vous assurer que le bug vient bien du plugin X. Cela vous évitera d’écrire sur le forum d’une contribution qui n’est finalement pas en cause.
  • Cherchez et notez les numéros de version de tout ce qui est en place au moment du test :
    • version de SPIP, en bas de la partie privée
    • version du plugin testé et des éventuels plugins nécessités
    • version de PHP (exec=info en partie privée)
    • version de MySQL / SQLite
  • Si votre problème concerne la partie publique de votre site, donnez une URL où le bug est visible, pour que les gens puissent voir par eux-mêmes.
  • En cas de page blanche, merci d’activer l’affichage des erreurs, et d’indiquer ensuite l’erreur qui apparaît.

Merci d’avance pour les personnes qui vous aideront !

Par ailleurs, n’oubliez pas que les contributeurs et contributrices ont une vie en dehors de SPIP.

Qui êtes-vous ?
[Se connecter]

Pour afficher votre trombine avec votre message, enregistrez-la d’abord sur gravatar.com (gratuit et indolore) et n’oubliez pas d’indiquer votre adresse e-mail ici.

Ajoutez votre commentaire ici

Ce champ accepte les raccourcis SPIP {{gras}} {italique} -*liste [texte->url] <quote> <code> et le code HTML <q> <del> <ins>. Pour créer des paragraphes, laissez simplement des lignes vides.

Ajouter un document

Suivre les commentaires : RSS 2.0 | Atom