Hello Mathieu,

There are a few things not right there:

1. Notice how on the left you have selected "no wrap (head)". This means
   that the JavaScript you put in will be executed right when the page
   loads, and it won't wait for the DOM to be ready or for other content
   to load.
   You can solve this by wrapping your code in
   `window.addEvent('domready', function(){ /* your code */ });`, or use
   the "onDomready" option on the left .

2. The second part (dealing with the "video2" and "pvideo2" elements)
   will throw errors nomatter what, since the "video2" and pvideo2"
   elements don't exist in your example.
   This is probably just cause it's a small example, though, so I don't
   expect it to be a problem.

3. Your "video1" element has a "display: none" style. That basically
   means that, nomatter how much you slide, it won't be visible anyway.
   You can solve this by removing the `style="display:none;"`, and using
   Fx.Slide's `hide` method to initially hide the "video1" element.

4. Using Fx.Slide's `show` method will make the "video1" element appear
   right away, I assume you're using Fx.Slide because you want it to
   slide, so you should probably use the `slideIn` method instead.

Combined, that results in this:
http://jsfiddle.net/LaG5s/2/

You can also use Fx.Slide's `toggle` method, to be able to hide the
"video1" element using the same button easily:
http://jsfiddle.net/LaG5s/3/

Tim.

Reply via email to