add active class & add text

This commit is contained in:
wlx 2013-06-16 15:38:17 +00:00
parent 74cf7212d8
commit 0c27367b7a
1 changed files with 2 additions and 2 deletions

View File

@ -34,13 +34,13 @@ table thead tr th {background:#EBF2F6;color:#444;}
<div class="btn-group">
<button tabindex="-1" class="btn" type="submit">搜索</button>
<button tabindex="-1" data-toggle="dropdown" class="btn dropdown-toggle">
<span class="caret"></span>
专题<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:void(0);" onclick="$('#code').val('');$('#search').submit()">所有专题</a></li>
<?php if(!empty($this->source)) { ?>
<?php foreach($this->source as $v) { ?>
<li><a href="javascript:void(0);" onclick="$('#code').val('<?= $v['id'] ?>');$('#search').submit()"><?= $v['code'] ?></a></li>
<li<?php echo ($this->code==$v['id'])?' class="active"':''; ?>><a href="javascript:void(0);" onclick="$('#code').val('<?= $v['id'] ?>');$('#search').submit()"><?= $v['code'] ?></a></li>
<?php } }?>
</ul>
</div>