Skip to content

Commit bc3d72c

Browse files
authored
Menu as mouse over. (#348)
1 parent edc377a commit bc3d72c

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Leave the `googleAnalytics` key empty to disable it.
127127

128128
### Logo
129129

130-
A logo can be selected, two parameters `logo` and `logo_small` can be defined. By default `logo` is used for medium and big screens and the `logo_small` value will be used when the site is rendered on small screens. Also there is the posibility to disable the logo and render a alternative text.
130+
A logo can be selected, two parameters `logo` and `logo_small` can be defined. By default `logo` is used for medium and big screens and the `logo_small` value will be used when the site is rendered on small screens. Also there is the possibility to disable the logo and render a alternative text.
131131

132132
```toml
133133
[params]
@@ -345,6 +345,15 @@ The social links on the right side are configured as a top-level menu.
345345
pre = "<i class='fas fa-2x fa-facebook'></i>"
346346
```
347347

348+
### Menu behavior
349+
350+
The dropdown menu is displayed by default when the user clicks on the menu item. However, you can also use the `dropdown_mouse_over` setting to change this behavior and use the mouse over instead.
351+
352+
```toml
353+
[params]
354+
dropdown_mouse_over = true
355+
```
356+
348357
### Blog post thumbnails
349358

350359
After creating a new post you can define a banner by entering the relative path to the image.

exampleSite/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ paginate = 10
445445
# Format dates with Go's time formatting
446446
date_format = "January 2, 2006"
447447

448+
dropdown_mouse_over = false
449+
448450
disabled_logo = false
449451
logo_text = "Universal"
450452

layouts/partials/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<header class="navbar-affixed-top" data-spy="affix" data-offset-top="62">
2-
<div class="navbar navbar-default yamm" role="navigation" id="navbar">
2+
<div class="navbar navbar-default yamm {{ if .Site.Params.dropdown_mouse_over }}mouseover{{ end }}" role="navigation" id="navbar">
33
<div class="container">
44
<div class="navbar-header">
55
<a class="navbar-brand home" href="{{ "/" | relLangURL }}">

static/js/front.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $(function () {
1414
fullScreenContainer()
1515
productDetailGallery(4000)
1616
menuSliding()
17+
menuMouseOver()
1718
productDetailSizes()
1819
utils()
1920
animations()
@@ -153,6 +154,12 @@ function menuSliding () {
153154
})
154155
}
155156

157+
function menuMouseOver () {
158+
$('.mouseover .dropdown').hover(function () {
159+
$('.dropdown-toggle', this).trigger('click')
160+
})
161+
}
162+
156163
/* animations */
157164
function animations () {
158165
var delayTime = 0

0 commit comments

Comments
 (0)