Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging running video button css
    primarykey
    data
    text
    <p>I'm using a background player that works like this:</p> <pre><code> function Background(flashID) { this.flashID = flashID; this.swfRef = null; this.onReady = function() { }; this.registerswfRef = function() { if (this.swfRef == null) this.swfRef = swfobject.getObjectById(this.flashID); }; this.playMovieByNum = function(movieID) { this.registerswfRef(); this.swfRef.playMovieByNum(movieID); }; </code></pre> <p>And this order to call the video:</p> <pre><code>var background = new Background('back_1');// id for the backgground movie function onReady(id) { //this function will run when the background has finished loading the xml. //console.log('backgorund is now ready '+id); // id is passed from flash file. }; window.onload =function() { document.getElementById('video1').onclick=function(){background.start(); background.playMovieByNum(1); }; document.getElementById('video2').onclick=function(){background.start(); background.playMovieByNum(2); }; document.getElementById('video3').onclick=function(){background.start(); background.playMovieByNum(3); }; document.getElementById('video4').onclick=function(){background.start(); background.playMovieByNum(4); }; document.getElementById('video5').onclick=function(){background.start(); background.playMovieByNum(5); }; document.getElementById('video6').onclick=function(){background.start(); background.playMovieByNum(6); }; document.getElementById('video7').onclick=function(){background.start(); background.playMovieByNum(7); }; document.getElementById('video8').onclick=function(){background.start(); background.playMovieByNum(8); }; }; </code></pre> <p>I need the background of the button relative the running video changes color.</p> <p>For example, if the video "1" is running, the button '#video1' will get the background "#EF4123", if not background is "none".</p> <p>I tried adding it, but only changes the background when you click on the button:</p> <pre><code>this.playMovieByNum = function(movieID) { this.registerswfRef(); this.swfRef.playMovieByNum(movieID); for(i = 1; i &lt;= 8; i++) { if(i == movieID) $("#video" + i).css("background", "#EF4123"); else $("#video" + i).css("background", ""); } }; </code></pre> <p>I need it to change automatically when changing the video also.</p> <p>You can see this working here: <a href="http://luisgustavoventura.com" rel="nofollow">http://luisgustavoventura.com</a></p> <p>Suggestions please. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload