怎么把动态的select改成ul导航形式。求指导。

看下代码。

 <!-- 大系列 --> <td style="visibility: hidden;">{$lang.big_series}<select name="big_cate_id" id="big_cate_id"> <option value="">{$lang.please_select}</option> {foreach from=$big_series item=big}<option value="{$big.sapval}" rel="{$big.cat_id}">{$big.cat_name}</option>{/foreach} </select> </td> </tr> <!-- 小系列 --> <!-- <td>{$lang.sub_series}<select name="sub_cate_id" id="sub_cate_id" onchange="searchGoods;"> <option value="">{$lang.please_select}</option> {foreach from=$sub_series item=sub}<option value="{$sub.sapval}" class="s{$sub.parent_id}">{$sub.cat_name}</option>{/foreach} </select> </td> --> <!-- 商品号or商品名 --> <tr> <td align="center"> <input type="text" name="keyword" size="15" placeholder="产品名号" style="height:19px;line-height:19px;" /> <input type="submit" value="搜索产品" class="button" /> </td> </tr> <tr> <td>{$lang.sub_series}<select name="sub_cate_id" id="sub_cate_id" onchange="searchGoods;" size="20"> {foreach from=$sub_series item=sub}<li value="{$sub.sapval}" class="s{$sub.parent_id}">{$sub.cat_name}</li>{/foreach} </select> </td> </tr> $document.readyfunction{ $#big_cate_id.changefunction{ var sapval = $this.val; var cat_id = 0; $this.findoption.eachfunction{ if$this.attrvalue == sapval{ cat_id = $this.attrrel; } }; $#sub_cate_id.empty; $#sub_cate_id.append<option value="">{$lang.please_select}</option>; ifsapval == { forvar i=0,len=subcate.length; i<len; i++{ $#sub_cate_id.append"<option value="+ subcate[i].sapval +">" + subcate[i].cat_name + "</option>"; } }else{ forvar i=0,len=subcate.length; i<len; i++{ ifsubcate[i].parent_id == cat_id{ $#sub_cate_id.append"<option value="+ subcate[i].sapval +">" + subcate[i].cat_name + "</option>"; } } } };
};
{/literal}
listTable.recordCount = {$record_count};
listTable.query = list;
listTable.pageCount = 1;
{foreach from = $filter item = item key = key}
listTable.filter.{$key} = {$item};
{/foreach} function searchGoods { listTable.filter[big_cate_id] = document.forms[searchForm].elements[big_cate_id].value; listTable.filter[sub_cate_id] = document.forms[searchForm].elements[sub_cate_id].value; listTable.filter[keyword] = Utils.trimdocument.forms[searchForm].elements[keyword].value; listTable.filter[src] = {$src}; listTable.loadList;
} ![图片描述][1]

select标签有个属性size可以

发表评论

电子邮件地址不会被公开。 必填项已用*标注