Question

I could really use some help on this one. I need to add a class to the body tag when someone presses the play button on a Vimeo embed.

The background on the site is white and when someone presses the play button, a class is added to the body tag so the background fades to black (body class="bgcolor_black"). And when the movie is paused or stops it goes back to the white background (body class="bgcolor_white").

Is this possible? The site is built on Wordpress. I have searched alot but all I can find is about a extra button to "turn the lights off".

Thanks in advance and sorry if the english is bad :)

Was it helpful?

Solution

This cannot be done unless vimeo.com allows your domain to execute cross-domain interaction. It is not allowed for security reasons. This security measure is known as the Same Origin Policy.

OTHER TIPS

Try this with jQuery!

http://api.jquery.com/addclass/

If you have trouble with implementing comment this answer!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top