Khaki - HTML

Contents

1. Google Map API Warning (NoApiKeys)

2. Make menu dropdown work without JavaScript

3. Add top menu link inside dropdown on mobile devices

1. Google Map API Warning (NoApiKeys)

If you want to use Google Maps, you should get API key.

In template HTML files you should find google maps api js file. Example:

<script src="https://maps.googleapis.com/maps/api/js"></script>;

And add to this address your API key. Example:

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>

How to generate API key see here - https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key

2. Make menu dropdown work without JavaScript

The most of functionality in our templates and themes made by using JavaScript. But sometimes you need to disable it in your browser and menu dropdowns will not work. The solution is simple - just add these styles in noscript section:

<noscript>
    <style type="text/css">
        .nk-navbar .nk-nav .nk-drop-item:hover > .dropdown {
            display: block;
            opacity: 1;
        }
    </style>
</noscript>

3. Add top menu link inside dropdown on mobile devices

Sometimes you may need to access your top menu link on your mobile devices, but in our themes this work only like a dropdown toggler. This code may help you:

jQuery(function ($) {
    $('#nk-nav-mobile .dropdown').each(function () {
        var $this = $(this);
        var $item = $this.prev('a');
        if ($item.length) {
            $this.children('li:not(.bropdown-back):eq(0)').before($('<li>').append($item.clone()));
        }
    });
});

Menu items will be added here: