Show css elements upon movie completion?

User avatar
Cah
3StarLounger
Posts: 293
Joined: 26 Mar 2010, 10:53

Show css elements upon movie completion?

Post by Cah »

Is it possible to hide a link/button and only have it show up once an embedded movie has played through to the end? Or is it necessary to make the whole thing in flash? I suppose a jscript timer could be used. I'm wondering if there is a way to have buttons appear without using flash or jscript. If it helps I have Dreamweaver 5.5 and know a little about php. Thanks,

Chris

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Show css elements upon movie completion?

Post by agibsonsw »

If you want to wait until the movie completes then this would require a little bit of JavaScript or perhaps Flash. If the movie runs in a player then the player itself might expose an event that you can catch in JS to then change the CSS property to hide the button. Although, as you suggest, it might require a JS timer (setInterval) to keep checking the status of the player. For example, I believe a YouTube player has a JavaScript API allowing you to check the current status of the player, to discover when it is completed.

Dreamweaver uses Spry, which is a JavaScript framework. This may enable you to achieve what you want without having to manually type the JavaScript - but I dunno as I don't use it :grin:

CSS3 now has transitions and animations. So, as an alternative, you could just use CSS to delay the appearance of your button and just fade it. It would not be connected to the completion of your video; I don't know the maximum time you can use; and it requires modern browsers to work reliably.

Probably haven't helped a great deal.. but HNY anyway :cheers:
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.