slider
ID: 3861300 • Letter: S
Question
Here i have you used visibilty property to change the image, i choose this because for z-index property the pictures may overaly and in some way or the other i have to use visibilty attribute over there, that is why i choose visibilty property
function changeimage(image_name) { var dom1 = document.getElementById('fig1').style; var dom2 = document.getElementById('fig2').style; var dom3 = document.getElementById('fig3').style; if (image_name == "saw") { dom1.visibility = "visible"; dom2.visibility = "hidden"; dom3.visibility = "hidden"; } else if (image_name == "spanner") { dom2.visibility = "visible"; dom1.visibility = "hidden"; dom3.visibility = "hidden"; } else if (image_name == "hoe") { dom3.visibility = "visible"; dom2.visibility = "hidden"; dom1.visibility = "hidden"; } }Explanation / Answer
b693ab7e6488b4fe93c3065d8d5fa90e2b9801060e8eb70e03a69fa788d6971e
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.