1. JavaScript / Говнокод #24214

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    $(document).ready(function() {
    	console.log("Ready");
    
    	var
    		block_1 = document.getElementsByClassName('block_1')[0],
    		block_2 = document.getElementsByClassName('block_2')[0],
    		block_3 = document.getElementsByClassName('block_3')[0],
    		block_4 = document.getElementsByClassName('block_4')[0],
    		open_1 = document.getElementsByClassName('open-1')[0],
    		open_2 = document.getElementsByClassName('open-2')[0],
    		open_3 = document.getElementsByClassName('open-3')[0],
    		open_4 = document.getElementsByClassName('open-4')[0];
    	
    
    	open_1.onclick = function(){
    		block_1.style.display = "block";
    		block_2.style.display = "none";
    		block_3.style.display = "none";
    		block_4.style.display = "none";
    	};
    
    	open_2.onclick = function() {
        	block_2.style.display = "block";
        	block_1.style.display = "none";
        	block_3.style.display = "none";
    		block_4.style.display = "none";
    	};
    
    	open_3.onclick = function() {
        	block_2.style.display = "none";
        	block_1.style.display = "none";
        	block_3.style.display = "block";
    		block_4.style.display = "none";
    	};
    	
    	open_4.onclick = function() {
        	block_2.style.display = "none";
        	block_1.style.display = "none";
        	block_3.style.display = "none";
    		block_4.style.display = "block";
    	};
    });

    Запостил: DNRAWW, 02 Мая 2018

    Комментарии (6) RSS

    Добавить комментарий