Skip to content

Commit

Permalink
Menu as mouse over. (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfox1985 authored Mar 19, 2022
1 parent edc377a commit bc3d72c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Leave the `googleAnalytics` key empty to disable it.

### Logo

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.
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.

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

### Menu behavior

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.

```toml
[params]
dropdown_mouse_over = true
```

### Blog post thumbnails

After creating a new post you can define a banner by entering the relative path to the image.
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ paginate = 10
# Format dates with Go's time formatting
date_format = "January 2, 2006"

dropdown_mouse_over = false

disabled_logo = false
logo_text = "Universal"

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/nav.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header class="navbar-affixed-top" data-spy="affix" data-offset-top="62">
<div class="navbar navbar-default yamm" role="navigation" id="navbar">
<div class="navbar navbar-default yamm {{ if .Site.Params.dropdown_mouse_over }}mouseover{{ end }}" role="navigation" id="navbar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand home" href="{{ "/" | relLangURL }}">
Expand Down
7 changes: 7 additions & 0 deletions static/js/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $(function () {
fullScreenContainer()
productDetailGallery(4000)
menuSliding()
menuMouseOver()
productDetailSizes()
utils()
animations()
Expand Down Expand Up @@ -153,6 +154,12 @@ function menuSliding () {
})
}

function menuMouseOver () {
$('.mouseover .dropdown').hover(function () {
$('.dropdown-toggle', this).trigger('click')
})
}

/* animations */
function animations () {
var delayTime = 0
Expand Down

0 comments on commit bc3d72c

Please sign in to comment.