Vicky
Vicky

Reputation: 982

jquery-1.8.2.min.js disable drop down menus

I am fetching data from database using jquery in search bar as user enter some character in it will fetch data from database the search is working perfectly but it disable my drop down menus on the top and when i remove jquery-1.8.2.min.js from the page the search module stop working and drop down menus start working . i have tried jquery-2.1.0.min.js but did not get the result.Here is my coding.please help me out.

    <form action="view_cat.php" method="post" >
    <input type="text" name="search" class="autosuggest" >

    <script src="js/jquery-1.8.2.min.js"></script> 
    <script src="js/javascrip.js"></script>

<script>
     $(document).ready(function() {
         $('.autosuggest').keyup(function() {
             var search_term=$(this).attr('value');
             $.post('search.php', {search_term:search_term},function(data){
                 $('.result').html(data);               
                 $('.result li').click(function(){
                 var result_value=$(this).text();
                 $('.autosuggest').attr('value', result_value);
                 $('.result').html('');
             });
             });
         });
     });
</script>
     </body>
     </html>

The drop down menus script.

<script>
    $(function () {
        var example = $('#sf-menu').superfish({
            delay:       400,
            animation:   {opacity:'show',height:'show'},
            speed:       'fast', 
            autoArrows:  false
        });

    });
</script>

Please suggest me some Alternative path.

Upvotes: 2

Views: 446

Answers (1)

Aitazaz Khan
Aitazaz Khan

Reputation: 1605

if you are using template than for sure I can say there should be another jquery file which are conflicting with each other please check out the file if you have another jquery file remove it and as far I am seeing your calling your jquery above the body so remove the jquery script from the bottom and put in the head section will work fine I hope.

Upvotes: 2

Related Questions