Skip to main content
mellowg33848581
Participant
May 25, 2017
Answered

Hide/show menu

  • May 25, 2017
  • 4 replies
  • 1570 views

Hello,

In need of some help here. I want to create a navigation menu where the menu shows when I mouse over a picture and the menu disappears on mouse out. Till here things worked out (see Greece/Persia pic: www.laiglewargames.com). Problem is when I am on the menu and wanting to select a naviagation item the menu does not remain stable and ofcourse when I go out of the pic it disappears. What is the solution for this?

Thanks in advance,

Jurgen

This topic has been closed for replies.
Correct answer osgood_

My guess is they are looking for the below BUT I doubt they will be back. Hover should be replaced by an onclick event. You would need to then somehow provide an 'alert' that the images need to be clicked to show the menus.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>L'Aigle Wargames</title>

<style>

img {

max-width: 100%;

height: auto;

}

body {

background-image: url(http://www.laiglewargames.com/pictures/GradientSpacer.jpg);

background-repeat: repeat-x;

background-color: #FFFFCD;

}

.page-wrapper {

width: 87%;

margin: 50px auto;

border: 2px solid #670097;

background-color: #CC996B;

}

.contact-button {

width: 200px;

margin: 30px auto 15px auto;

}

.image-plate {

width: 696px;

margin: 0 auto 25px auto;

padding: 0;

position: relative;

}

.image-plate nav {

position: absolute;

top: -50px;

right: -200px;

background-color: #DCBB8C;

padding: 25px 25px 15px 25px;

border: 2px solid #670097;

z-index: 100;

}

.image-plate nav ul {

margin: 0;

padding: 0;

list-style: none;

}

a {

display: block;

margin: 0;

padding: 0 0 20px 0;

color: #670097;

font-family: "Times New Roman", Serif;

font-style: italic;

font-size: 18px;

font-weight: 600;

}

</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<script>

$(document).ready(function() {

$('.image-plate nav').hide();

$('.image-plate').mouseenter(function() {

$('.image-plate nav').fadeOut();

$(this).find('nav').fadeIn(500);

});

$('.image-plate').mouseleave(function() {

$('.image-plate nav').fadeOut(500);

});

});

</script>

</head>

<body>

<div class="page-wrapper">

<img src="http://www.laiglewargames.com/pictures/L%27AigleHeader.jpg" alt="" style="border-bottom: 2px solid #670097">

<figure class="contact-button">

<a href="http://www.laiglewargames.com/ContactPage.html"><img src="http://www.laiglewargames.com/pictures/ContactButton.jpg" width="200" height="121" alt=""></a>

</figure>

<!-- end contact-button -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/TheWorldOfGreeceAndPersia.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Rome,-hammer-of-conquest.png"" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/DarkAges.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Renaissance.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Reformation.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/SunKingRevolution.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Napoleon.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/WarsOfEmpire.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

</div>

<!-- end page-wrapper -->

</body>

</html>

4 replies

Nancy OShea
Community Expert
Community Expert
May 25, 2017

Looks like you're trying to create an off canvas menu like the one shown below.

Desktop:

Mobile:

And the code:

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>Bootstrap Off Canvas Layout</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!-- Latest compiled and minified Bootstrap CSS-->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<style>

html, body { overflow-x: hidden; /* Prevent scroll on narrow devices */ }

body { padding-top: 70px; }

footer { padding: 30px 0; }

/**OFF CANVAS**/

@media screen and (max-width: 767px) {

.row-offcanvas {

    position: relative;

    -webkit-transition: all .25s ease-out;

    -o-transition: all .25s ease-out;

    transition: all .25s ease-out;

}

.row-offcanvas-right { right: 0; }

.row-offcanvas-left { left: 0; }

.row-offcanvas-right  .sidebar-offcanvas { right: -50%; /* 6 columns */ }

.row-offcanvas-left  .sidebar-offcanvas { left: -50%; /* 6 columns */ }

.row-offcanvas-right.active { right: 50%; /* 6 columns */ }

.row-offcanvas-left.active { left: 50%; /* 6 columns */ }

.sidebar-offcanvas {

    position: absolute;

    top: 0;

    width: 50%; /* 6 columns */

}

}

</style>

</head>

<body class="container-fluid">

<!--begin off canvas Toggle button-->

<div class="row row-offcanvas row-offcanvas-right">

<div class="col-xs-12 col-sm-9">

<p class="pull-right visible-xs">

<button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle Menu </button>

</p>

<div class="jumbotron">

<h1>Hello, world!</h1>

<p>This is an example of an off canvas layout in Bootstrap. Resize your viewport to see it in action.</p>

</div>

<div class="row">

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-primary" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-success" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-warning" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-danger" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-info" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

<div class="col-xs-6 col-lg-4">

<h2>Heading</h2>

<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>

<p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>

</div>

<!--/.col-xs-6.col-lg-4-->

</div>

<!--/row-->

</div>

<!--/.col-xs-12.col-sm-9-->

<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">

<div class="list-group"> <a href="#" class="list-group-item active">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> <a href="#" class="list-group-item">Link</a> </div>

</div>

<!--/.sidebar-offcanvas-->

</div>

<!--/row-->

<!--Minified jQuery-->

<script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous">

</script>

<!--Minifed Bootstrap-->

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<script>

//OFF CANVAS MENU FUNCTION

$(document).ready(function () {

  $('[data-toggle="offcanvas"]').click(function () {

    $('.row-offcanvas').toggleClass('active')

  });

});

</script>

</body>

</html>

Nancy O'Shea— Product User & Community Expert
Legend
May 25, 2017

No the OP is not trying to create an off canvas menu (I doubt they even know what that is). All they want is for a menu to come into view when they hover over the image strips.

osgood_Correct answer
Legend
May 25, 2017

My guess is they are looking for the below BUT I doubt they will be back. Hover should be replaced by an onclick event. You would need to then somehow provide an 'alert' that the images need to be clicked to show the menus.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>L'Aigle Wargames</title>

<style>

img {

max-width: 100%;

height: auto;

}

body {

background-image: url(http://www.laiglewargames.com/pictures/GradientSpacer.jpg);

background-repeat: repeat-x;

background-color: #FFFFCD;

}

.page-wrapper {

width: 87%;

margin: 50px auto;

border: 2px solid #670097;

background-color: #CC996B;

}

.contact-button {

width: 200px;

margin: 30px auto 15px auto;

}

.image-plate {

width: 696px;

margin: 0 auto 25px auto;

padding: 0;

position: relative;

}

.image-plate nav {

position: absolute;

top: -50px;

right: -200px;

background-color: #DCBB8C;

padding: 25px 25px 15px 25px;

border: 2px solid #670097;

z-index: 100;

}

.image-plate nav ul {

margin: 0;

padding: 0;

list-style: none;

}

a {

display: block;

margin: 0;

padding: 0 0 20px 0;

color: #670097;

font-family: "Times New Roman", Serif;

font-style: italic;

font-size: 18px;

font-weight: 600;

}

</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<script>

$(document).ready(function() {

$('.image-plate nav').hide();

$('.image-plate').mouseenter(function() {

$('.image-plate nav').fadeOut();

$(this).find('nav').fadeIn(500);

});

$('.image-plate').mouseleave(function() {

$('.image-plate nav').fadeOut(500);

});

});

</script>

</head>

<body>

<div class="page-wrapper">

<img src="http://www.laiglewargames.com/pictures/L%27AigleHeader.jpg" alt="" style="border-bottom: 2px solid #670097">

<figure class="contact-button">

<a href="http://www.laiglewargames.com/ContactPage.html"><img src="http://www.laiglewargames.com/pictures/ContactButton.jpg" width="200" height="121" alt=""></a>

</figure>

<!-- end contact-button -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/TheWorldOfGreeceAndPersia.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Rome,-hammer-of-conquest.png"" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/DarkAges.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Renaissance.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Reformation.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/SunKingRevolution.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/Napoleon.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

<figure class="image-plate">

<nav>

<ul>

<li><a href="GreecePersiaPeloponneseTaras.html">1. Early Peloponnese & Taras</a></li>

<li><a href="GreecePersiaGreekPersianWars.html">2. Greek-Persian wars</a></li>

<li><a href="GreecePersiaSyracuse.html">3. The wars of Syracuse</a></li>

<li><a href="GreecePersiaPeloponnesianWar.html">4. The Peloponnesian War</a></li>

<li><a href="GreecePersiaAlexanderTheGreat.html">5. Alexander the Great</a></li>

<li><a href="GreecePersiaDiadochi.html">6. The Diadochi</a></li>

<li><a href="GreecePersiaPhotographs.html">Game photographs</a></li>

</ul>

</nav>

<img src="http://www.laiglewargames.com/pictures/WarsOfEmpire.png" width="696" height="200" alt="">

</figure>

<!-- end image-plate -->

</div>

<!-- end page-wrapper -->

</body>

</html>

pziecina
Legend
May 25, 2017

First, if you are not experianced in using css, have never heard of css keyframe animations or you wish your menu to work on anything older than 5 years, read no further.

First you would use css keyframe animations to set up a forward animation, this would bring your menu into view using the normal hover/touch/click event on the image. Then you would set up a second animation that would play the forward animation but in reverse, this you would trigger by using a 'close' menu item, from within the menu, or anywhere else you would like it to be.

The close menu item, you could even have apear when the forward animation is played. You would set up your menu as normal using ul/li items, styled and 'hidden' as normal using css.

You could even set the animation up to open the menu, leave it open for a given time, then close. The option to pause the animation when the user hovers over the menu, would naturally only work if they use a mouse.

Don't ask for a demo, or the code.

Note: The reason for no demo or code, is because it is a holiday weekend here in the UK, and i am sitting in the hotel garden, with my barbecued spare-ribs, (with sauce) a bottle of house white wine, (in iced chiller) and reading, (its a pleasent 24C), and will not be at my computer until late next week.

Just thought i would say that to annoy you all .

Nancy OShea
Community Expert
Community Expert
May 25, 2017

mellowg33848581  wrote

I want to create a navigation menu where the menu shows when I mouse over a picture...

A mouse over or hover event won't trigger on touch screen devices because they don't have a mouse.  More people use tablets, hybrids and mobile devices now than ever before.  What will those people do when they can't see your menu? 

Best advice, avoid slick gimmicks and keep things simple for everyone to use.  Your site visitors will thank you.

Nancy

Nancy O'Shea— Product User & Community Expert
Rob Hecker2
Legend
May 25, 2017

I think most of us don't do it the way you describe. I question it would work on mobile. We use a javascript toggle on the icon or text for selecting the menu.

<style>

#menu {

display:none;

}

.responsive {

dis;lay:block;
   }

</style>

<p class='menutoggle'><a href='javascript:void(0);' style='font-size:2rem;' onclick='menutoggle()'>☰</a></p>

<script>
function menutoggle() {
    var x = document.getElementById("menu");
    if (x.className === "menu responsive") {
        x.className += "menu";
    } else {
        x.className = "menu responsive";
    }
}

</script>