1
I’m studying about :Hover, onMouseOver and onMouseOut. Suppose in this situation I want to change the background of an image when passing the mouse on top of her.
What is the correct way to program? It’s using CSS (:Hover) or through Javascript (onMouseOver and onMouseOut)? Because?
<div id="img1">
<img src="https://vignette.wikia.nocookie.net/unmario/images/a/ad/300px-Nsmb-mushroom-super.jpg/revision/latest?cb=20081217191119">
</div>
<div id="img2">
<img src="https://vignette.wikia.nocookie.net/unmario/images/a/ad/300px-Nsmb-mushroom-super.jpg/revision/latest?cb=20081217191119">
</div>
CSS whenever possible. A question: this application will be used on tablets or phones?
– Sergio
Yes, the user will be able to access through the phone ! So it is good to avoid javascript right?
– Sora
So it’s good to avoid this functionality :) Describes how you would do
:hover
ormouseover
did not exist.– Sergio
Vish, would do something like leave two images superimposed and one becomes invisible or something like kkkk (if there was no
mouseover
or:hover
)– Sora