Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //
  2.  
  3. //
  4.  
  5. function resizebutton(div)
  6. {
  7. if (div == 'leftpanel'){
  8. #this code shrinks the other divs, it should run first, without any other divs being enlarged
  9. document.getElementById('middlepanel').style.width = '20%';
  10. document.getElementById('rightpanel').style.width = '20%';
  11. }
  12. if (div == 'middlepanel'){
  13. document.getElementById('leftpanel').style.width = '20%';
  14. document.getElementById('rightpanel').style.width = '20%';
  15. }
  16. if (div == 'rightpanel'){
  17. document.getElementById('leftpanel').style.width = '20%';
  18. document.getElementById('middlepanel').style.width = '20%';
  19. }
  20.  
  21.  
  22. }
  23.  
  24. function resizeMeFirst(div, callback) {
  25. document.getElementById(div).style.width = '50%';
  26. //ok, now that that is done, run the callback function.
  27. callback(div)
  28. }
  29.  
  30. resizeMeFirst(div, resizebutton);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement