Question

In: Computer Science

-Insert an h2; you decide the content. -Below your headings put an image of you and...

-Insert an h2; you decide the content.

-Below your headings put an image of you and an image of your pet or favorite animal.

-Use a function to swap the positions of the images when the mouse is over either image. (Call the same function in the onmouseover event handler for both images. The function will load images in the appropriate positions.)

-Swap the images back to their original positions when the mouse is moved off of the images (Use the same function and pass different values with the parameters. This function will load both of the original images.)

-YES!! Please Use JavaScript

Solutions

Expert Solution

Please use the appropriate image name or image path for "your image" and "pet image".

In this code mypic.jpg, mypet.jpeg and index.html are saved in the same directory. Read the comments to better understand the code.

index.html code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Title</title>

  <script language="JavaScript">  
    function setImage(imagePath){
      // getElementById() method returns the element that has the ID attribute with the specified value
      imageView = document.getElementById("imageView");
      // we set the src of this img tag with imagePath
      imageView.src=imagePath;
    }
  </script>

</head>
<body>

  <h2>INSERT YOUR CONTENT</h2>
  <!-- mypet.jpeg is the image of my pet and is placed in the same folder where the HTML file is saved -->
  <!-- mypic.jpeg is my image and is placed in the same folder where the HTML file is saved -->

  <!-- when onMouseOver event is triggered "mypet" image is set as src by the function setImage -->
  <!-- when onMouseOut event is triggered "mypic" image is set as src by the function setImage -->
  <img src="mypic.jpg" 
    id="imageView" 
    height="300px" 
    onMouseOver="setImage('./mypet.jpeg');"
    onMouseOut="setImage('./mypic.jpg');"> 
  
</body>
</html>

Related Solutions

The content that you put out as part of your digital marketing content strategy is a...
The content that you put out as part of your digital marketing content strategy is a critical piece of a successful digital marketing plan. What are 3 major considerations when deciding on what type of content to publish?
You observe the content of 2 email messages. An email may contain an image with probability...
You observe the content of 2 email messages. An email may contain an image with probability 0.35. An image is equally likely to be 3 MB or 6 MB. Assume that an email without an image is 1 MB. a) Determine the probability mass function of X (the total size of all emails observed) b) What is the expected value of the total size of all emails? c) What is the standard deviation of the total size of all emails.
Your task is to take the below code, and insert comments (using the “%” symbol) next...
Your task is to take the below code, and insert comments (using the “%” symbol) next to each line of code to make sure that you know what every line does. clc clear close all NMax = 100; partialSum = 0; exactAnswer = pi^2; for k=1:NMax partialSum = partialSum + 6/k^2; percentDiff(k) = abs(partialSum - exactAnswer)/exactAnswer*100; end NVector = [1:NMax]; plot(NVector,percentDiff); xlabel('{{Noob}}'); ylabel('% Difference');
In MATLAB: (a) Insert a comment in your script that says Problem 1: (b) Below this...
In MATLAB: (a) Insert a comment in your script that says Problem 1: (b) Below this comment, generate a vector of values called x that starts at −10, ends at 8, and has a step size of 0.1 between points. (c) Define the function f(x) = (x − 6)(x 2 − 1)(x + 8) in your script, then plot f(x) against x. (d) Plot the x- and y-axes on the plot in part (c). Mark each of the x-intercepts on...
What is the length of the blue line labeled r in the Image below? Give your...
  What is the length of the blue line labeled r in the Image below? Give your answer in terms of a and b.
Pretend that you have been put on a committee at school or college that must decide...
Pretend that you have been put on a committee at school or college that must decide whether to start random drug testing at school or college and that students must agree to this in order to remain enrolled. Using information from the text about marijuana, alcohol and opioids, briefly describe how each could affect a student's behavior on campus and also off campus when completing homework. Then write your own opinion as to why you think this could be a...
Pretend that you have been put on a committee at school or college that must decide...
Pretend that you have been put on a committee at school or college that must decide whether to start random drug testing at school or college and that students must agree to this in order to remain enrolled. Using information from the text about marijuana, alcohol and opioids, briefly describe how each could affect a student's behavior on campus and also off campus when completing homework. Then write your own opinion as to why you think this could be a...
Problem 1 As an option trader you decide to sell a straddle by selling a put...
Problem 1 As an option trader you decide to sell a straddle by selling a put option and a call option on the same stock. The put option has a strike price of K1 = $50 and is priced for P = $5, and the call option has a strike price K2 = K1 = $50 and priced for C = $7. Construct a table showing the payoff and profit you would get from this strategy based on the stock...
Put your name here Course Title: HSM 543 Health Service Finance Class Week 6: You Decide...
Put your name here Course Title: HSM 543 Health Service Finance Class Week 6: You Decide Assignment Professor’s Name: Scenario you sat in the CFO chair, studied a real world hospital Accounts Receivable (AR) problem with your team, and came up with a Process Improvement Plan to reduce Days in Accounts Receivable and improve cash flow to you hospital. Well the great news is that your plan worked! This morning your Days in AR stand at 67. Not perfect.... but...
In order to take out a loan, you are required to put up some type of collateral. You decide to offer 1,000 shares of your ZG Corp
In order to take out a loan, you are required to put up some type of collateral. You decide to offer 1,000 shares of your ZG Corp. stock which is valued at $100 per share. You are concerned that the stock price will increase to $125 before you repay the loan and the lender will sell your shares of stock for a profit. How could you manage this risk using a financial derivative?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT