jQuery autocomplete in background of input text box

前端 未结 2 1530
攒了一身酷
攒了一身酷 2021-02-14 15:15

I have a jQuery text box autocomplete script which uses a PHP script to query a MySQL database. Currently, a result is displayed under the text box however I want it to appear a

2条回答
  •  无人共我
    2021-02-14 15:58

    i am still not sure where exactly you want the effect if its the text box then on keyup event change the previous text color property to a dim color i.e.

    $('#query').css('color','gray');

    this will change the color of the text to gray. Or you can try changing the opacity of it as well.

    style of id

    #gray

    used by google.

    #grey {
        background: none repeat scroll 0 0 #FFFFFF;
        border-color: transparent;
        color: silver;
        overflow: hidden;
        position: absolute;
        z-index: 1;
    }
    

    so in first step you display the autosuggested text using z-index and in the next step you display the text which user typeded in and that will give you the same effect of google.

提交回复
热议问题