• sunnydeville

    (@sunnydeville)


    Hi,

    Im having a little difficulty trying to figure out were the second part of the code shown below goes..

    document.addEventListener('mouseover',hoverVideo,false);
    var vid = document.getElementById('video-example');
    
    function hoverVideo(a)
    {
        if(a.target == vid)
        {
            vid.play();
            this.addEventListener('mouseout',hideVideo,false);
        }
    
    }
    
    function hideVideo(e)
    {
        if(e.target == vid)
        {
            vid.pause();
        }
    
    }
    </blockquote>
    Which is to activate a Hover over effect for a video which is this code..
    
    <blockquote><!doctype html>
    <html lang="en">
    <head>
    </head>
    
    <body>
    
        <div id="wrapper">
            <video id="video-example" width="100" height="100" poster="http://urchn.org/wp/wp-content/uploads/2010/04/bbb-splash.png" loop="true">
                <source src="http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.ogg" type="video/ogg"></source>
            </video>
            </div><!--end wrapper-->
    
    </body>
    </html>

    Where would i place the first code to activate the second code when placed in the post or page? ive tried to place it in the Function.php as well as the Header and Footer but all i get is a string error

The topic ‘Code Placement…’ is closed to new replies.