1. <script>
  2.  
  3. function resizeAnimated (){
  4. // Get a handle to the player
  5. var myPlayer = wimpy.getPlayer("myPlayer");
  6. // Set up animation
  7. myPlayer.setAnimate(500, "ease-in");
  8. // Now resize the player
  9. myPlayer.setSize(600, 300);
  10. // Turn off animation after the resize is complete:
  11. setTimeout(turnOffAnimation, 500);
  12. }
  13.  
  14.  
  15. function turnOffAnimation(){
  16. // Get a handle to the player
  17. var myPlayer = wimpy.getPlayer("myPlayer");
  18.  
  19. // Cancel animation
  20. myPlayer.setAnimate(null);
  21. }
  22.  
  23.  
  24. function resizeNormal (){
  25.  
  26. // Get a handle to the player
  27. var myPlayer = wimpy.getPlayer("myPlayer");
  28. // Cancel animation (just in-case)
  29. myPlayer.setAnimate(null);
  30. // Resize the player
  31. myPlayer.setSize(400, 200);
  32.  
  33. }
  34.  
  35. </script>
  36.  
  37.  
  38.  
  39.  
  40. <div id="myPlayer" data-wimpyplayer data-width="300" data-height="100"></div>
  41.  
  42.  
  43. <!-- A simple button to ping the "doit" function. -->
  44. <p><input type="button" onclick="resizeAnimated()" value="Resize Player Animated"></p>
  45. <p><input type="button" onclick="resizeNormal()" value="Resize Normal"></p>
giItT1WQy@!-/#