联系官方销售客服
1835022288
028-61286886
怎么样把这段搜索代码来设置搜索默认的值
现在,点击搜索按钮以后,然后直接就显示【音频】的结果去了,实际上应该是默认先显示到【视频】的结果上的,怎么样可以调整默认先显示到【视频】先。有没有大师帮我看看
<div class="tab"> <span data-media="video">视频</span> <span class="active" data-media="audio">音频</span> <span data-media="tuwen">图文</span> </div> <script> $(function(){ var keyword="{$_GPC['keyword']}"; var flid="{$_GPC['flid']}"; var tid="{$_GPC['tid']}"; tydata(tid,flid,keyword,'audio'); //音视图点击 $('.content .tab span').click(function(){ var media=$(this).data('media'); $(this).addClass('active').siblings().removeClass('active'); tydata(tid,flid,keyword,media); }) }) function tydata(tid,flid,keyword,media) { var cont=''; $.ajax({ url:"{php echo $this->createMobileUrl('Tongyongdata');}", type:'GET', dataType:'json', data:{ flid:flid, tid:tid, keyword:keyword, media:media }, success:function(res){ console.log(res) if(res.errno==0){ $.each(res.data, function(k, v) { cont+="<a href="+(v.media=='tuwen'?"{php echo $this->createMobileUrl('mediadetail');}":"{php echo $this->createMobileUrl('mediamenu');}")+"&menuid="+v.id+"&media="+v.media+">" cont+="<li class='sell-li'>" cont+="<img class='sell-img' src={php echo $_W['attachurl']}"+v.thumb+" />" cont+="<div class='sell-mess'>" cont+="<p class='dec'>"+(v.menuname?v.menuname:v.tuwenname)+"</p>" cont+="<p class='message'>"+(v.jianjie?v.jianjie:'')+"</p>" cont+="<p class='message'>" cont+="<img src='../addons/kuowan_video/template/mobile/img/book.png'>"+(v.ksnum?v.ksnum:1)+"课时" cont+="</p>" cont+="</div>" cont+="</li>" cont+="</a>" }); if(cont!=''){ $(".wrapper-conter").html(cont); }else{ $(".wrapper-conter").html("<h4 style='text-align:center;margin-top:1.2rem;'>暂无内容哦!</h4>"); } } }, error:function(res){ } }); } </script>