Question

Make a pull-down menu that includes selections for a different sort of menu. For DHTML in...

Make a pull-down menu that includes selections for a different sort of menu. For DHTML in javascript..

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE

<!DOCTYPE html>
<html>
<head>
<style>


.dropbtn:hover, .dropbtn:focus {
background-color: #DAA520;
}

.dropdown {
position: relative;
display: inline-block;
}

.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}

.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}

.dropbtn {
background-color: #FF8C00;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}

.dropdown a:hover {background-color: #f1f1f1}

.show {display:block;}
</style>
</head>
<body>


<p>Click on the button to open the dropdown menu.</p>

<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Dropdown</button>
<div id="myDropdown" class="dropdown-content">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</div>
</div>

<script>
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}

// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {

var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>

</body>
</html>

OUTPUT

Hope your question has been resolved. Please do not forget to give a positive like to the answer. Thank you.

Add a comment
Know the answer?
Add Answer to:
Make a pull-down menu that includes selections for a different sort of menu. For DHTML in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use the pull down menu to state whether the series converges or diverges and by which...

    Use the pull down menu to state whether the series converges or diverges and by which convergence test. 3m 4 (1y Vn+3 8" n! g0- 32 443 (-1'n Σ 4n+4 00 Σ (+: 4 4 n7 n15 W Converges-Integral/Comparison Test Converges-Ratio Test Converges-Alternating Series Test Diverges-Integral/Comparison Test Diverges-Ratio Test Diverges-Alternating Series Test Use the pull down menu to state whether the series converges or diverges and by which convergence test. 3m 4 (1y Vn+3 8" n! g0- 32 443 (-1'n...

  • The pull down assay described in Tutorial 7 is similar to co-immunoprecipitation technique described earlier in...

    The pull down assay described in Tutorial 7 is similar to co-immunoprecipitation technique described earlier in this course. Which of the following are differences between the IP/co-IP techniques and the pull down assay? Select all that apply. The co-IP assay utilizes antibody specific to the target protein. The pull down assay is used to study protein-protein interactions. O A pull down assay enables researchers to test the binding affinity of protein fragments The detection method used is different, co-IPs use...

  • Phase one implementation: 1-The menu of selections implemented in main function. 2- Each choice should be...

    Phase one implementation: 1-The menu of selections implemented in main function. 2- Each choice should be implemented in the main function. 3- The data is saved permanently in a file. Problem Description: Assume one of the companies in Qatar who is renting flats for people asks you to develop a small system to help them track who paid the rent fees, and who did not for the coming month. The data in this system includes: ID number of the person...

  • 1-If you want a user to make a selection from a list of items, and you...

    1-If you want a user to make a selection from a list of items, and you only want them to be able to select ONE item in the list, which type of web form input control should you use? a checkbox a radio button or a drop-down menu a scrollable menu with mutliple selections allowed none of the above 2-<textarea name="contest_entry" rows="5" cols="50"></textarea> The code above will create a: с single line text entry field drop-down menu multiline text entry...

  • Diversity and Society o While we all need food, we make our selections for a variety...

    Diversity and Society o While we all need food, we make our selections for a variety of different reasons. This is an opportunity to address why we as individuals make the choices we do and to reflect upon the impact those choices have on our community and environment. You will also have the opportunity to consider the impact large corporations have on the health of people and communities, as well as how government policies, in the US and abroad influence...

  • Using the knowledge gained about different cooking methods , design a 2 day Menu for some...

    Using the knowledge gained about different cooking methods , design a 2 day Menu for some one who recently recovered from heart attack . Please mention about the cooking techniwque used for each meal on the menu.  Make sure to include healthy products and health y cooking methods 

  • Write a java program to sort arrays using 3 different methods: Bubble Sort, Selection Sort and...

    Write a java program to sort arrays using 3 different methods: Bubble Sort, Selection Sort and Insertion Sort. The numbers to be sorted will be obtained using a library function which generates pseudo-random numbers. TO Do 1. Fill an array with 140 real numbers between 0.00 and 945.00. Generate the numbers using the subroutine that generates random numbers. Make a spare copy of the array; you will need it later. 2. Call a subroutine to print the contents of the...

  • Mountain pull. A large mountain can slightly affect the direction of “down” as determined by a...

    Mountain pull. A large mountain can slightly affect the direction of “down” as determined by a plumb line. Assume that we can model a mountain as a sphere of radius R = 2.00 km and density (mass per unit volume) 2.6 × 103 kg/m3. Assume also that we hang a 0.500m plumb line at a distance of 3R from the sphere's center and such that the sphere pulls horizontally on the lower end. How far would the lower end move...

  • Drop-down menu: Favorable, unfavorable and neither Question 18 Charlatte Company has determined that the standard cost...

    Drop-down menu: Favorable, unfavorable and neither Question 18 Charlatte Company has determined that the standard cost to manufacture its product includes 2 units of direct materials at $6.00 per unit. During January, the company purchased 50,800 units of direct materials at a cost of $5.80 per unit and used 50,800 units of direct materials to produce 23,400 units of its product. Calculate the total materials variance, and the price and quantity variances. Materials Variance Materials Price Variance Materials Quantity Variance...

  • Show the alkyl bromide and alcohol used to make methyl t-butyl ether using the Williamson ether...

    Show the alkyl bromide and alcohol used to make methyl t-butyl ether using the Williamson ether synthesis to the right of the retrosynthetic arrow. Complete the general mechanism by adding curved arrows and drawing the final organic product. (Note that R is an abbreviation for any alkyl group and can be found on the bottom row in the pull down periodic table in the drawing tools menu.)

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT