Created
April 3, 2011 18:53
-
-
Save douglasZwick/900669 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dan, | |
| You can find the image files that my code calls for in http://dougzwick.com/digipen/resources/. | |
| Specifically, you want | |
| • http://dougzwick.com/digipen/resources/mute.png | |
| • http://dougzwick.com/digipen/resources/muteover.png | |
| • http://dougzwick.com/digipen/resources/mutedown.png | |
| • http://dougzwick.com/digipen/resources/unmute.png | |
| • http://dougzwick.com/digipen/resources/unmuteover.png | |
| • http://dougzwick.com/digipen/resources/unmutedown.png | |
| This is just in case you want to try to build a little project that works the way I want mine to. | |
| Thanks for EVERYTHING (even the things for which you're obviously not responsible, | |
| like the invention of the telescope and the weekend)! | |
| Doug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| div#toolbox | |
| { | |
| width: 112px; | |
| height: 24px; | |
| margin: 0 auto 0 auto; | |
| padding: 0; | |
| } | |
| div#mutediv | |
| { | |
| width: 64px; | |
| height: 24px; | |
| margin: 0 auto 0 auto; | |
| padding: 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="toolbox"> | |
| <div id="mutediv" style="display: none"> | |
| <a href="#" onMouseOver="wrapp.onMouseOverMuteButton()" | |
| onMouseOut="wrapp.onMouseOutMuteButton()" | |
| onMouseDown="wrapp.onMouseDownMuteButton()" | |
| onMouseUp="wrapp.onMouseUpMuteButton()"> | |
| <img id="mutebutton" src="resources/mute.png" alt="Mute Button" /> | |
| </a> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var WrApp = function() | |
| { | |
| var audioMuted = false; // ...among other variables | |
| /* . | |
| . | |
| . */ | |
| // Earlier in the code.... | |
| document.getElementById("mutediv").style.display = "block"; | |
| /* . | |
| . | |
| . */ | |
| var onMouseOverMuteButton = function() | |
| { | |
| if (!audioMuted) | |
| { | |
| document.getElementById("mutebutton").src = "resources/muteover.png"; | |
| } else | |
| { | |
| document.getElementById("mutebutton").src = "resources/unmuteover.png"; | |
| } | |
| } | |
| var onMouseOutMuteButton = function() | |
| { | |
| if (!audioMuted) | |
| { | |
| document.getElementById("mutebutton").src = "resources/mute.png"; | |
| } else | |
| { | |
| document.getElementById("mutebutton").src = "resources/unmute.png"; | |
| } | |
| } | |
| var onMouseDownMuteButton = function() | |
| { | |
| if(!audioMuted) | |
| { | |
| document.getElementById("mutebutton").src = "resources/mutedown.png"; | |
| } else | |
| { | |
| document.getElementById("mutebutton").src = "resources/unmutedown.png"; | |
| } | |
| } | |
| var onMouseUpMuteButton = function() | |
| { | |
| introMusicAudio.toggleMute(); | |
| loopMusicAudio.toggleMute(); | |
| if(!audioMuted) | |
| { | |
| document.getElementById("mutebutton").src = "resources/unmute.png"; | |
| } else | |
| { | |
| document.getElementById("mutebutton").src = "resources/mute.png"; | |
| } | |
| audioMuted = true; | |
| } | |
| } // End of WrApp function | |
| window.onload = function() | |
| { | |
| var wrapp = new WrApp(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment