Menu

[Solved]-Q2 Define Term Event Handler Context Javascript Dhtml B Write Webpage Containing Image Bug Q37202775

Hello,

Please assist with part *2(d)* of this questionin html and javascript. Thank you.Q.2. a) Define the term event handler in the context of Javascript and DHTML. b) Write a webpage containing an image (bugl.

Q.2. a) Define the term ‘event handler’ in the context of Javascript and DHTML. b) Write a webpage containing an image (bugl.jpg). Write a suitable event handler to make 14] the image change to bug2.jpg when the user clicks it 15] bug2.jpg bug 1 jpg c) Write suitable code, using window.setTimeout, to make the bug smoothly move diagonally across the screen. The bug should move 1 pixel do times per second d) Assuming you know that the screen is 800 pixels wide and 600 pixels high, explain (in plain English) how you would make the bug appear to ‘”bounce’ (by changing the direction of its movement) when it hits the screen edges. Provide appropriate lines of Javascript code to illustrate your explanation [6 Show transcribed image text Q.2. a) Define the term ‘event handler’ in the context of Javascript and DHTML. b) Write a webpage containing an image (bugl.jpg). Write a suitable event handler to make 14] the image change to bug2.jpg when the user clicks it 15] bug2.jpg bug 1 jpg c) Write suitable code, using window.setTimeout, to make the bug smoothly move diagonally across the screen. The bug should move 1 pixel do times per second d) Assuming you know that the screen is 800 pixels wide and 600 pixels high, explain (in plain English) how you would make the bug appear to ‘”bounce’ (by changing the direction of its movement) when it hits the screen edges. Provide appropriate lines of Javascript code to illustrate your explanation [6

Expert Answer


Answer to Q.2. a) Define the term ‘event handler’ in the context of Javascript and DHTML. b) Write a webpage containing an image (… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *