Web page help. I am a beginner

I’m working on a project for my html/css class. I’m trying to get the menu options to drop down with a mouseover using jquery. Any help will be much appreciated.

<!DOCTYPE html>
<html lang="en-us">
    <head>
        <title>The Mountain Spoke: Best Biking EVER!</title>
        <meta charset="utf-8">
        <meta name="description" content="The Mountain Spoke: Exciting locals around the world to biking">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="styles/main.css">
        <link rel="stylesheet" href="styles/medium.css">
        <link rel="stylesheet" href="styles/large.css">
        <link rel="stylesheet" href="styles/normalize.css">
        <link href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow" rel="stylesheet">
        <script src="//code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>       
        <script>
            $(function(){
                
                $('.dropdownMenu > li').hover(function(){
                    $(this).children("ul").slideToggle(200);
                });

            })
	   </script>
    </head>
    <body onload="theDate()">
        <header>
            <img class="logo" src="images/logo.jpg" alt="The mountain biking site logo">
            <div class="company">
                <h1 class="spoke">The Mountain Spoke</h1>
                <div class="title">World-class biking for the world!</div>    
            </div>
            <button onclick="Menu()" class="hamburger">&#9776;</button> 
        </header>
        <nav>
            <ul class="navbar">
                <li class="nav"><a href="home.html">Home</a></li>
                <li class="nav"><a href="adventure-tours.html">Adventure Tours</a></li>
                <li class="nav"><a href="events.html">Events</a></li>
                <li class="nav"><a href="sales.html">Sales</a></li>
                <li class="nav"><a href="service.html">Service</a></li>
                <li class="nav"><a href="contact-us.html">Contact Us</a></li>
            </ul>
        </nav>
        <main>
            <section class="salespage">
                <div>
                    <ul class="dropdownmenu">
                        <li class="bike"><img src="images/cannondale-2017-cannondale-trail-5small.jpg" alt="cannondale 2017 mountain bike">
                            <ul class="fall">
                                <li class="bike">$599</li>
                                <li class="bike">The perfect ride for someone getting into mountain biking. The traill offers the best performance value on the mountain and is ready for anything from racing to full-blown trail duty.</li>
                            </ul>
                        </li>
                        <li class="bike"><img src="images/cannondale-2018-cannondale-catalyst-4small.jpg" alt="cannondale 2018 mountain bike" class="bikepic">
                            <ul class="fall">
                                <li class="bike">$399</li>
                                <li class="dobikewn">Satisfy your urge for adventure! The Catalyst is a lightweight Alloy frame, great riding position, and a wide range in gearing. Ride down the trail in confidence.</li>
                            </ul>
                        </li>
                        <li class="bike"><img src="images/cannondale-2018-cannondale-fat-caad-2-slasmall.jpg" alt="cannondale 2018 fat tire mountain bike" class="bikepic">
                            <ul class="fall">
                                <li class="bike">$1899</li>
                                <li class="bike">A fatbike without the fat? The Fat CAAD 2 is so lightweight and the nimble front geometry gives you the agility on the trail and speed that you will want to ride this bike all year long!</li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </section>
            <p>*Prices are subject to change.
                    <br>
                    **Not all bikes are listed. If there are any questions don't hesitate to contact us at, <a href="contact-us.html">Click Here!</a></p>
        </main>
        <footer>
            <script src="scripts/date.js"></script>
            <script src="scripts/menu.js"></script>
            <div class="info">
                <p>The Mountain Spoke</p>
                <p>406-587-5404</p>
                <p>3950 Valley Commons Drive Bozeman, MT</p>
            </div>
            <div class="bar">&copy;2018 | All Rights Reserved | The Mountain Spoke | <span id="demo"></span> 
            </div>
        </footer>
    </body>
    






</html>
/* Delete these CSS comments after reading. */
/* This main css file contains the default rules and is geared toward the small/phone view */


* { box-sizing: border-box;}  /* This wildcard applies to all elements ensuring a box layout model */

body {
    font-size: 16px;
    font-family: sans-serif; /* Declare the base font-family */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

header, nav, main, footer { /* the comma between the selectors means apply the following CSS declarations to all of the listed elements */
  max-width: 100%; /* Declare the maximum width and other main element rules to limit the stretch on larger/wider views */
}

.navbar {
    margin-bottom: 20px;
}

.nav {
    display: inline-flex;
    flex-flow: row;
    border-top: solid 1px black;
    padding: 6px;
    background-color: #228B22;
}

.navbar.responsive {
    display: block;   
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.logo {
    max-height: 150px;
}

.company {
    display: inline;
    position: absolute;
    
}

.spoke {
    position: relative;
    padding-top: 5px;
    padding-bottom: none;
    font-family: 'PT Sans Narrow', sans-serif;
    font-size: 3em
}

.title {
    margin-left: 25px;
    margin-top: 20px;
    font-family: 'Oxygen', sans-serif;
    font-size: 1.1em;
}

footer {
    display: flex;
    flex-direction: column;
    border-top:solid 1px black;
    text-align:center;
    /*bottom:0;
    width:100%;*/
    margin-top:25px;
    background-color: #aa7243;
}

.info {
    padding: none;
}

form fieldset {
    margin: 2rem 0;
    border: 1px solid #445ba9;
    border-radius: 10px;
    padding: .5rem 2%;
}

form legend {
    color: #445ba9;
    margin: 0 1rem;
    text-align: center;
}

form label.top, form div {

    display: block;
    padding-top: 1rem;
    color: #9c2c13;
    font-size: .8rem;
}

form label.top input, form label.top select {
    display: block;
    font-size: 1rem;
    border: solid 1px #999;
    border-radius: 4px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 20rem;
    background-color: rgba(0,0,0,0.1);
}

form label.middle input, form label.middle select {
    display: block;
    font-size: 1rem;
    border: solid 1px #999;
    border-radius: 4px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 20rem;
    background-color: rgba(0,0,0,0.1);
    background-color: white;
}

    form fieldset label.interest {
    display: block;
    font-size: 1.2rem
}

form fieldset label.interest input {
    margin-right: 5px;
}

form label.top input {
    background-color: white;
}

form label.middle {
    display: block;
    padding: .75rem;
    color: #555;
}

form input.button {
    border: none;
    background-color: #9c2c13;
    color: white;
    border-radius: 1rem;
    padding: .75rem 1.5rem;
    margin: 0 0 2rem 2%;
    width: 96%;
    max-width: 20rem;
}

form label.top input:required {
    border-left: red solid 6px;
}

form label.top input:required:valid {
    border-left: green solid 6px;
}

.repair {
    width: 100%;
    height: 200px;
}

.repairs {
    text-align: center;         
}

section.forecast { 
        display: inline-flex;
        justify-content: center;
        }

th, td {
        border: 1px solid black;
        padding-right: 8px;
        text-align: center;
    }

.drop {
	position:absolute;
	top:0px;
	bottom:0px;
	left:0px;
	right:0px;
	width:960px;
	height:100px;
	margin:auto;
	list-style:none;
	padding:0px;
	border-top: 4px solid red;
}

.down {
	width: 190px;
	height: 48px;
	float: left;
	text-align: center;
	background:rgb(240, 240, 240);
	font-family: sans-serif;
	line-height: 3.6;
	text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
	font-size: 14px;
	margin: 1px;
}

.down > .drop {
	position:relative;
	width:190px;
	clear:both;
	/* Hide the Submenus */
	display:none;
}

.fall {
	position:absolute;
	top:0px;
	bottom:0px;
	left:0px;
	right:0px;
	width:960px;
	height:100px;
	margin:auto;
	list-style:none;
	padding:0px;
	border-top: 4px solid red;
}

.bike {
	width: 190px;
	height: 200px;
	float: left;
	text-align: center;
	background:rgb(240, 240, 240);
	font-family: sans-serif;
	line-height: 3.6;
	text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
	font-size: 14px;
	margin: 1px;
}

.bike > .fall {
	position:relative;
	width:190px;
	clear:both;
	/* Hide the Submenus */
	display:none;
}



@media only screen and (max-width: 37.5em) {

    .hamburger {
    display: inline;
    position: absolute;
    top: 180px;
    left: 25px;
    padding: 4px 13px;
    font-size: 30px;
    }
    
    .nav {
        display: block;
    }
    
    .navbar {
        display: none;
    }
    
    .info, .bar {
        font-size: 10px;
    }
    
    .banner {
        font-size: 1.8em;
        text-align: center
    }
    
    
}

Well, welcome to the forums.

There’s two problems immediately obvious in your code:
1: <script src="//code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
Something’s missing at the start of that URL…while the browser will account for this, it’s best to actually specify the protocol for readability.

2: $('.dropdownMenu > li').hover(function(){
<ul class="dropdownmenu">
One of these things is not like the other… (CSS selectors are case sensitive! EDIT: Well, technically it’s the HTML that’s case sensitive, but that inherits case sensitivity onto selectors.)

So, I have two pages on the same site that should have almost identical functionality. Your pointers helped me fix the one that I initially posted about, but I can’t get this other page figured out. Thank you in advance for any help.

<!DOCTYPE html>
<html lang="en-us">
    <head>
        <title>The Mountain Spoke: Best Biking EVER!</title>
        <meta charset="utf-8">
        <meta name="description" content="The Mountain Spoke: Exciting locals around the world to biking">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="styles/main.css">
        <link rel="stylesheet" href="styles/medium.css">
        <link rel="stylesheet" href="styles/large.css">
        <link rel="stylesheet" href="styles/normalize.css">
        <script src="https//code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>       
        <script>
            $(function(){
                
                $('.dropdownmenu > li').hover(function(){
                    $(this).children("ul").slideToggle(200);
                });

            })
	   </script>
        <link href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow" rel="stylesheet">
        
    </head>
    <body onload="theDate()">
        <header>
            <img class="logo" src="images/logo.jpg" alt="The mountain biking site logo">
            <div class="company">
                <h1 class="spoke">The Mountain Spoke</h1>
                <div class="title">World-class biking for the world!</div>    
            </div>
            <button onclick="Menu()" class="hamburger">&#9776;</button>        
        </header>
        <nav>
            <ul class="navbar">
                <li class="nav"><a href="home.html">Home</a></li>
                <li class="nav"><a href="adventure-tours.html">Adventure Tours</a></li>
                <li class="nav"><a href="events.html">Events</a></li>
                <li class="nav"><a href="sales.html">Sales</a></li>
                <li class="nav"><a href="service.html">Service</a></li>
                <li class="nav"><a href="contact-us.html">Contact Us</a></li>
            </ul>
        </nav>
        <main>
            <section class="servicepage">
                <div class="repairimage">
                    <img class="repair" src="images/maintenancerepair.jpg" alt="bike repairs">
                    <h1 class="repairs">Repairs</h1>
                </div>
                <div>
                    <ul class="dropdownmenu">
                        <li class="down">Tires
                            <ul class="drop">
                                <li class="tire">Flat Repair-$35</li>
                                <li class="down">New Tube-$15</li>
                                <li class="down">New Tire(back)-$55</li>
                                <li class="down">New Tire(front)-$43</li>
                            </ul>
                        </li>
                        <li class="down">Tune Up
                            <ul class="drop">
                                <li class="parts">Brakes &amp; Gears-$25 </li>
                                <li class="parts">Whole Bike-$45</li>
                            </ul>
                        </li>
                        <li class="down">Full Bike
                            <ul class="drop">
                                <li class="down">Bike Assemble $$ varies</li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <!--<table>
                    <thead>
                        <tr>
                            <th>Repair</th>
                            <th>Cost</th>
                            <th>Timeframe</th>
                        </tr>
                    </thead>
                    <tbody>  
                        <tr>
                            <td>Flat repair</td>
                            <td>$35</td>
                            <td>Same Day</td>                            
                        </tr>
                        <tr>
                            <td>Tune up </td>
                            <td>$30</td>
                            <td>Same Day</td>                            
                        </tr>
                        <tr>
                            <td>New Tube</td>
                            <td>$27.50</td>
                            <td>Same Day</td>                            
                        </tr>
                        <tr>
                            <td>New Tire</td>
                            <td>$45</td>
                            <td>2-3 days</td>                            
                        </tr>
                        <tr>
                            <td>brake repair</td>
                            <td>$10</td>
                            <td>Same Day</td>                            
                        </tr>
                        <tr>
                            <td>brke overhaul</td>
                            <td>$75</td>
                            <td>2 Days</td>                            
                        </tr>
                    </tbody>
                </table>-->
                <p>*Costs and Timeframe are subject to change depending on supplies on hand and shipping times.</p>
                <p>**Not all possible repairs are listed. If there are any questions don't hesitate to contact us at, <a href="contact-us.html">Click Here!</a></p>
            </section>
        </main>
        <footer>
            <script src="scripts/date.js"></script>
            <script src="scripts/menu.js"></script>
            <div class="info">
                <p>The Mountain Spoke</p>
                <p>406-587-5404</p>
                <p>3950 Valley Commons Drive Bozeman, MT</p>
            </div>
            <div class="bar">&copy;2018 | All Rights Reserved | The Mountain Spoke | <span id="demo"></span> 
            </div>
        </footer>
    </body>
</html>
/* Delete these CSS comments after reading. */
/* This main css file contains the default rules and is geared toward the small/phone view */


* { box-sizing: border-box;}  /* This wildcard applies to all elements ensuring a box layout model */

body {
    font-size: 16px;
    font-family: sans-serif; /* Declare the base font-family */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    background-color: #D6D6D6;
}

header, nav, main, footer { /* the comma between the selectors means apply the following CSS declarations to all of the listed elements */
  max-width: 100%; /* Declare the maximum width and other main element rules to limit the stretch on larger/wider views */
}

.navbar {
    margin-bottom: 20px;
}

.nav {
    display: inline-flex;
    flex-flow: row;
    border-top: solid 1px black;
    padding: 6px;
    background-color: #228B22;
}

.navbar.responsive {
    display: block;   
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.logo {
    max-height: 150px;
}

.company {
    display: inline;
    position: absolute;
    
}

.spoke {
    position: relative;
    padding-top: 5px;
    padding-bottom: none;
    font-family: 'PT Sans Narrow', sans-serif;
    font-size: 3em
}

.title {
    margin-left: 25px;
    margin-top: 20px;
    font-family: 'Oxygen', sans-serif;
    font-size: 1.1em;
}

footer {
    display: flex;
    flex-direction: column;
    border-top:solid 1px black;
    text-align:center;
    /*bottom:0;
    width:100%;*/
    margin-top:25px;
    background-color: #aa7243;
}

.info {
    padding: none;
}

form fieldset {
    margin: 2rem 0;
    border: 1px solid #445ba9;
    border-radius: 10px;
    padding: .5rem 2%;
}

form legend {
    color: #445ba9;
    margin: 0 1rem;
    text-align: center;
}

form label.top, form div {

    display: block;
    padding-top: 1rem;
    color: #9c2c13;
    font-size: .8rem;
}

form label.top input, form label.top select {
    display: block;
    font-size: 1rem;
    border: solid 1px #999;
    border-radius: 4px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 20rem;
    background-color: rgba(0,0,0,0.1);
}

form label.middle input, form label.middle select {
    display: block;
    font-size: 1rem;
    border: solid 1px #999;
    border-radius: 4px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 20rem;
    background-color: rgba(0,0,0,0.1);
    background-color: white;
}

    form fieldset label.interest {
    display: block;
    font-size: 1.2rem
}

form fieldset label.interest input {
    margin-right: 5px;
}

form label.top input {
    background-color: white;
}

form label.middle {
    display: block;
    padding: .75rem;
    color: #555;
}

form input.button {
    border: none;
    background-color: #9c2c13;
    color: white;
    border-radius: 1rem;
    padding: .75rem 1.5rem;
    margin: 0 0 2rem 2%;
    width: 96%;
    max-width: 20rem;
}

form label.top input:required {
    border-left: red solid 6px;
}

form label.top input:required:valid {
    border-left: green solid 6px;
}

.repair {
    width: 100%;
    height: 200px;
}

.repairs {
    text-align: center;         
}

section.forecast { 
        display: inline-flex;
        justify-content: center;
        }

th, td {
        border: 1px solid black;
        padding-right: 8px;
        text-align: center;
    }

.drop {
	position:absolute;
	top:0px;
	bottom:0px;
	left:0px;
	right:0px;
	width:960px;
	height:100px;
	margin:auto;
	list-style:none;
	padding:0px;
	border-top: 4px solid red;
}

.down {
	width: 190px;
	/*height: 48px;*/
	float: left;
	text-align: center;
	background:rgb(240, 240, 240);
	font-family: sans-serif;
	line-height: 3.6;
	text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
	font-size: 14px;
	margin: 1px;
}

.down > .drop {
	position:relative;
	width:190px;
	clear:both;
	/* Hide the Submenus */
	display:none;
}

.fall {
	position:absolute;
	top:0px;
	bottom:0px;
	left:0px;
	right:0px;
	width:960px;
	height:100px;
	margin:auto;
	list-style:none;
	padding:0px;
	border-top: 4px solid red;
}

.bike {
	width: 190px;
	float: left;
	text-align: center;
	background:rgb(240, 240, 240);
	font-family: sans-serif;
	line-height: 3.6;
	text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
	font-size: 14px;
	margin: 1px;
}

.bike > .fall {
	position:relative;
	width:190px;
	clear:both;
	/* Hide the Submenus */
	display:none;
}





@media only screen and (max-width: 37.5em) {

    .hamburger {
    display: inline;
    position: absolute;
    top: 180px;
    left: 25px;
    padding: 4px 13px;
    font-size: 30px;
    }
    
    .nav {
        display: block;
    }
    
    .navbar {
        display: none;
    }
    
    .info, .bar {
        font-size: 10px;
    }
    
    .banner {
        font-size: 1.8em;
        text-align: center
    }
    
    
}

What about that page is wrong/not working? Instead of just showing the page and saying “its different”, tell us how we can help you.

Good point. Thanks for making me be more specific. I am trying to get the class, .drop, to drop down with the options below as I mouse over them. So, Tires, is in that class, there is a ul with four li’s under it. As I mouse over Tires I want the ul under it, class .drop, to appear below. Right now all it does is highlight the, .down class, Tires. In the first html page I submitted it was giving me the same problem, but the issues you hinted at resolved it on that page. I tried comparing the two pages to see what the difference was and other than the class names I’m not finding one. I even tried changing the class names to be the same in both html pages.

So I can spot an immediate error, one that should be glaring at you from the console.

What does the console tell you the current problem is?

I wasn’t able to look at this until this evening. Thank you for the help. That darn “:” was hiding from me.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.