1. Список говнокодов пользователя lasty

    Всего: 1

  2. JavaScript / Говнокод #22503

    −14

    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
    var interval = setInterval(function () {
                    
                $('head').append('<style>div.gsc-input-box INPUT.bg { background-image: url(/Resources/Layout/Images/search-home.png) !important;} </style>');
    
                input = $('div.gsc-input-box INPUT');
    
                if (input.get().length > 0) {
                        
                    if (Common.ClientInfo.isMSIE80 || Common.ClientInfo.isMSIE70) {
                            
                        input.addClass('bg');
    
                        function updateInput() {
    
                            if (input.val() == '') {
                                input.addClass('bg');
                            } else {
                                input.removeClass('bg');
                            }
    
                        }
    
                        input.keyup(updateInput).keydown(updateInput).change(updateInput);
    
                        setInterval(updateInput, 300);
    
                    } else {
                        input.attr('placeholder', 'Поиск');
                    }
                        
                    clearInterval(interval);
                }
            }, 200);

    lasty, 07 Марта 2017

    Комментарии (0)