P
P
Partizan Agent2016-07-10 21:47:02
css
Partizan Agent, 2016-07-10 21:47:02

The search is not working, how to fix it?

That is, I enter prntscr.com/br7a0c into common.js, I press it immediately goes to the finished result, you don’t enter the text ... template markup

<div class="search-wrapper"> 
<div class="input-holder">
<input type="text" name="search" value="" placeholder="Поиск" class="search-input">
<button class="search-icon" onclick="searchToggle(this, event);"><span></span></button> 
</div> 
<span class="close" onclick="searchToggle(this, event);"></span> 
</div>

Her native script for this search is here
function searchToggle(obj, evt){
            var container = $(obj).closest('.search-wrapper');

            if(!container.hasClass('active')){
                  container.addClass('active');
                  evt.preventDefault();
            }
            else if(container.hasClass('active') && $(obj).closest('.input-holder').length == 0){
                  container.removeClass('active');
                  // clear input
                  container.find('.search-input').val('');
                  // clear and hide result container when we press close
                  container.find('.result-container').fadeOut(100, function(){$(this).empty();});
            }
        }

        function submitFn(obj, evt){
            value = $(obj).find('.search-input').val().trim();

            _html = "Yup yup! Your search text sounds like this: ";
            if(!value.length){
                _html = "Yup yup! Add some text friend :D";
            }
            else{
                _html += "<b>" + value + "</b>";
            }

            $(obj).find('.result-container').html('<span>' + _html + '</span>');
            $(obj).find('.result-container').fadeIn(100);

            evt.preventDefault();
        }

For two days I have been suffering in any way I can set it up, help people who are sympathetic and kind !!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wheelie, 2016-01-18
@lebedev_sanyok

vertical-align: top;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question