组件实现类似百度的模糊搜索框

1、引入jquery
2、使用 $("#gov").autocomplete
3、css改变背景

前端


```html
<?php if (!defined('YIDE_VERSION')) exit(); ?>
<Admintemplate file="Common/Head"/>
<link href="http://code.jquery.com/ui/1.10.4/themes/ui-darkness/jquery-ui.css" />
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <Admintemplate file="Common/Nav"/>
    <style>
        .ke-dialog{
   top:100px;}

//搜索框背景及滚动条调整
        .ui-autocomplete {
   
            background: #fff !important;
            max-width: 390px;
            max-height: 200px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        /* IE 6 ��֧�� max-height
         * ����ʹ�� height ���棬�������ǿ�Ʋ˵�������ʾΪ�Ǹ��߶�
         */


    </style>

    <div class="h_a">需求添加</div>
    <form class="J_ajaxForm" action="{:U("Need/add")}" method="post" id="myform">
    <div class="table_full mb30">
        <table width="100%">
            <tr>
                <th width="100">需求图片</th>
                <td>
                    <!-- <div class="upload-file" style="display: inline-block;"> -->
                    <input type="file" class="input-file" accept=".jpg,.jpeg,.png,.gif" id="file" name="need_imgurl" >
                    <!--               <span class="tip">点击上传图片</span>
                                </div> -->
                </td>
            </tr>

            <tr>
                <th width="100">联系号码</th>
                <td><input type="text" name="telephone" value="" class="input" size="60" placeholder="手机号"></input></td>
            </tr>

            <tr>
                <th width="100">需求标题</th>
                <td><input type="text" name="need_title" value="" class="input" size="60" placeholder="需求标题"></input></td>
            </tr>

            <tr>
                <th width="100">单位</th>
                <td><input type="text" id="gov" name="gov" value="" class="input" size="60" placeholder="单位"></input></td>
                <input type="hidden" id="rid" name="gov_id" value="">
                <!--  <select name="rid" class="roomid" onchange="getqyinfo(this.value)">

                 </select> -->
            </tr>



            <if condition="$is_creator eq 1"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值