0

I am working on website and came across to JavaScript and need HELP.

I have a Youtube video and two images. One image is shown when we display the site, then the second image is shown after mouseover. But this second image should also be a link to the video. One major thing is that I WANT TO KEEP THE VIDEO in the same page (no pop-ups). Also the sizes of the images are small, but the video should be resized.

So far I know how to do the mouseover, but do not know how to make the video work in the same page. Thanks

My code of mouseover ---

<img src="1.png" onmouseover="this.src='2.png'" onmouseout="this.src='1.png'"/>
Brian
  • 4,958
  • 8
  • 40
  • 56

1 Answers1

0

Take a look at this answer: start/play embedded (iframe) youtube-video on click of an image

You can put your Youtube video inside of an iFrame and do the same thing except instead of a click() you'll be using mouseover/mouseout as you are.

Community
  • 1
  • 1
InspiredBy
  • 4,271
  • 6
  • 40
  • 67