0

I have a list of 8 videos from youtube in my app (thumbnails). I need to detect the click event in one of those videos, and them, via AJAX ($.post()) load the video in the same <div>. So, I have a problem... I can't detect the click event in the iFrame. And for my project (accessibility) I can't use plain images as the ones youtube uses in the thumbnails, without the play button! (this project is for mentally disabled kids to use youtube and a lot of rules must be followed!)

I use the jQuery framework! Any solutions?

Mattios550
  • 372
  • 1
  • 5
  • 18
Cafunfa
  • 45
  • 8
  • can you put some code here? – Dhaval Marthak Apr 16 '13 at 12:29
  • I use the iframe from youtube. Ex: `code` `code` The onClick event doesn't work. When I try $("#youtubeFrame").click(...) does not work. I have every iFrame inside one div, but i can't detect the click event in it too! (sorry my english! I'm portuguese!) – Cafunfa Apr 16 '13 at 13:12
  • Edit your question instead of commenting it. – Ahmet DAL Apr 16 '13 at 15:03
  • I would say this is not going to be very easy / precise. If you had control over the iframe content you could use messaging but being a youtube clip you wont have that. That being said a quick search found this question which seems very similar and does have a number of "working" solutions. Perhaps one will be acceptable for your situation? http://stackoverflow.com/questions/2381336/detect-click-into-iframe-using-javascript – Maurice Butler Apr 16 '13 at 15:16
  • Thanks Maurice Butler, I find the solution in that link! – Cafunfa Apr 16 '13 at 15:49
  • Can you use PrettyPhoto? http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ – ckpepper02 Apr 16 '13 at 16:54

0 Answers0