1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- {eyou:static file="skin/js/bootstrap-hover-dropdown.min.js" code="ask"/}
- <div class="sbox">
- <!-- 搜索 -->
- <div class="search">
- <form action="" method="get" name="search" id="search" onsubmit="return formSubmit();">
- <input type="hidden" name="ct" value="search">
- <input class="searchinput" name="q" placeholder="输入问题关键字" autocomplete="off" value="{$eyou.field.SearchName}">
- <span class="search-icon" id="search-bottom" onclick="formSubmit();"></span>
- <div class="search-result">
- </div>
- <div class="hot-list" style="display: none;" id="search_keywords_list">
- </div>
- </form>
- </div>
- <!-- END -->
-
- <!-- 栏目导航 -->
- <ul class="nav navbar-nav navbar-right navlist" id="asktypes">
- <li class="nav-item">
- <a href="{$eyou.field.NewDateUrl}" title="问答首页" class="link {eyou:eq name='$eyou.field.IsTypeId' value='0'}active{/eyou:eq}">问答首页</a>
- </li>
-
- {eyou:volist name="$eyou.field.TypeData" id="vo"}
- <li class="margin-left-0 nav-item">
- <a class="link {eyou:eq name='$eyou.field.IsTypeId' value='$vo.type_id'}active{/eyou:eq}" href="{$vo.Url}" data-hover="dropdown" aria-expanded="false">{$vo.type_name}
- {eyou:notempty name="$vo.SubType"}
- <span class="caret fa-angle-down"></span>
- {/eyou:notempty}
- </a>
- {eyou:notempty name="$vo.SubType"}
- <ul class="dropdown-menu dropdown-menu-right bullet" role="menu">
- {eyou:volist name="$vo.SubType" id="st"}
- <li><a href="{$st.Url}">{$st.type_name}</a></li>
- {/eyou:volist}
- </ul>
- {/eyou:notempty}
- </li>
- {/eyou:volist}
- </ul>
- <!-- END -->
- <div class="clearfix"></div>
- </div>
- <div class=" blank10"></div>
-
- <script type="text/javascript" charset="utf-8">
- $(function(){
- $('#search input[name=q]').click(function(){
- if ($('#search input[name=q]').val() == '') {
- $('#hot_keywords_list').show();
- }
- });
- });
-
- // 搜索提交
- function formSubmit()
- {
- var q = $('#search input[name=q]').val();
- var url = '{$eyou.field.NewDateUrl}';
- if (url.indexOf('?') > -1) {
- url += '&';
- } else {
- url += '?';
- }
- url += 'search_name=' + q;
- window.location.href = url;
- return false;
- }
- </script>
|