Click me to change size via class swap

  1. <style type="text/css" media="screen">
  2.  
  3. .size1 {
  4. width : 600px;
  5. height : 300px;
  6. }
  7.  
  8. .size2 {
  9. width : 300px;
  10. height : 150px;
  11. }
  12.  
  13. </style>
  14.  
  15. <script>
  16. var current = "size1";
  17. function changeSize(){
  18. var playerDIV = document.getElementById("player");
  19.  
  20. if(current == "size1"){
  21. current = "size2";
  22. } else {
  23. current = "size1";
  24. }
  25. playerDIV.className = current;
  26. }
  27. </script>
  28. <div id="player" class="size1" data-wimpyplayer data-responsive></div>
  29.  
  30. <p onclick="changeSize()">Click me to change size via class swap</p>
giItT1WQy@!-/#