123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- // 头部搜索 ----------------------------------------
- $('.seekinput_search span').on('mousemove',function(){ //显示切换框
- $('.seekinput_option').show();
- })
- $('.seek_box').on('mouseleave',function(){ //隐藏切换框
- $('.seekinput_option').hide();
- })
- $('.seekinput_option span').eq(1).attr('class','on'); //默认
- $('.seekinput_search input[qhid="2"]').show(); //默认
- $('.seekinput_option span').on('click',function(){
- $('.seekinput_search input[type="text"]').hide();
- var _html = $(this).html();
- $('.seekinput_search span i').html(_html);
- $('.seekinput_option').hide();
- $(this).attr('class','on').siblings().attr('class','');
- var _qhid = $(this).attr('qhid');
- $('.seekinput_search input[qhid="'+_qhid+'"]').show(); //选中的搜索输入框
- $('.seek_input input[type="button"]').attr('buttonid',_qhid); //选中的 类型 1为 楼盘列表 2为 视频列表
- $('.seekinput_search input[type="text"]').val(""); //清空input 内容
- })
- $('.seek_input input[type="button"]').on('click',function(){ //搜索跳转操作
- var _buttonid = $(this).attr('buttonid');
- var txt = $('.seek_input input[qhid="'+_buttonid+'"]').val();
- console.log(_buttonid);
- console.log(txt);
- if (txt != '') {
- switch(_buttonid)
- {
- case '1':
- window.open('/house/search?name='+ txt);
- break;
- case '2':
- window.location.href = '/video/videosearch?name='+ txt;
- break;
- }
-
- };
-
- })
- $(document).keydown(function(event){
- if(event.keyCode==13){
- $('.seek_input input[type="button"]').click();
- }
- });
- // 头部搜索 ----------------------------------------
- // 获取 "video" 视频元素时长
- $(function(){
- function myFunction(cid){
- cid.each(function(){
- var _this=$(this)
- _this.find('video.video_list_main')[0].addEventListener("loadedmetadata", function(){
- var tol = this.duration;//获取总时长
- var time = parseInt(tol);
- var minutes = parseInt(time / 60);
- var seconds =( time - minutes * 60);
- _this.find('.time_b').html(Appendzero(minutes)+':'+Appendzero(seconds))
- })
- })
- }
- function Appendzero (obj) { //时间补零
- if (obj < 10) return "0" + obj; else return obj;
- }
- myFunction($('.videosearch_box ul li'));
- });
|