浏览代码

h5搜索左右滑动bug

luyanan 7 年之前
父节点
当前提交
8efbb04397
共有 2 个文件被更改,包括 26 次插入7 次删除
  1. 2 2
      css/share.css
  2. 24 5
      js/search_h5.js

+ 2 - 2
css/share.css

@ -6,9 +6,9 @@ html,body {outline: 0;margin:0;padding:0px;background: #F4F6F8;-webkit-text-size
6 6
.logoA{width:24%; height: auto;position: absolute;left:50%;margin-left:-12%;top:6%;z-index: 2}
7 7
.bannerA img{display:block;margin-top:10%;}
8 8
.search-wrap{position: absolute;bottom: 16px;height: 40px;padding: 0 10px;width: 96%;left:50%;margin-left: -48%;
9
    background: rgba(255, 255, 255, .95);border-radius: 5px;overflow: hidden;}
9
    background: rgba(255, 255, 255, 1);border-radius: 5px;overflow: hidden;}
10 10
.search-wrap .search-icon{margin: 10px 4px;}
11
.search-wrap .search-input{position: absolute;left:0;top:0;width:100%;padding:0 10px 0 40px;font-size:14px;background:none;height:40px;line-height:40px;border:none}
11
.search-wrap .search-input{position: absolute;left:0;top:0;width:100%;padding:0 10px 0 40px;font-size:14px;background:none;height:40px;line-height:24px;border:none}
12 12
13 13
.iconfontnew{display: inline-block;width: 18px;height: 18px;*margin-right: .3em;line-height: 18px;vertical-align: text-top;
14 14
  background-position: center center; background-repeat: no-repeat;background-size: cover;}

+ 24 - 5
js/search_h5.js

@ -106,6 +106,14 @@ $(function() {
106 106
                	}
107 107
                	tabToFun(item)
108 108
                }, 300);
109
            }
110
            if(mySwiper.translate >= 50) {
111
                setTimeout(function() {
112
                    //刷新操作
113
                    mySwiper.update(); // 重新计算高度;
114
                }, 1000);
115
            }else if(mySwiper.translate >= 0 && mySwiper.translate < 50){
116

109 117
            }
110 118
            return false;
111 119
		}
@ -130,6 +138,7 @@ $(function() {
130 138
				$("#sele").addClass("displayNone");
131 139
				$("#searB").removeClass("searchboxNewT");
132 140
			}
141
			
133 142
		}
134 143
	});
135 144
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
@ -736,7 +745,7 @@ $(function() {
736 745
			})
737 746
		},
738 747
		clearToFun=function(sortN){
739
			$(objSort[sortN].conbox).html("");
748
			//$(objSort[sortN].conbox).html("");
740 749
			$('.w').css('transform', 'translate3d(0px, 0px, 0px)')
741 750
			$('.swiper-container2 .swiper-slide-active').css('height','auto').siblings('.swiper-slide').css('height','0px');
742 751
			mySwiper.update();
@ -778,22 +787,32 @@ $(function() {
778 787
			
779 788
			if(item==1 && tabLoad){
780 789
				expertBox();
790
				$(".loadtip").html('上拉加载更多');
791
				mySwiper.update(); 
781 792
			}else if(item==2 && tabLoad){
782 793
				resourceListVal();
794
				$(".loadtip").html('上拉加载更多');
795
				mySwiper.update(); 
783 796
			}else if(item==3 && tabLoad){
784 797
				articalListVal();
798
				$(".loadtip").html('上拉加载更多');
799
				mySwiper.update();
785 800
			}else if(item==4 && tabLoad){
786 801
				patentListVal();
802
				$(".loadtip").html('上拉加载更多');
803
				mySwiper.update();
787 804
			}else if(item==5 && tabLoad){
788 805
				paperListVal();
806
				$(".loadtip").html('上拉加载更多');
807
				mySwiper.update();
789 808
			}else if(item==6 && tabLoad){
790 809
				companyListVal();
810
				$(".loadtip").html('上拉加载更多');
811
				mySwiper.update();
791 812
			}else if(item==7 && tabLoad){
792 813
				serviceListVal();
793
			}
794
			if(tabLoad){
795
				$(".loadtip").html('上拉加载更多...');
796
				mySwiper.update(); // 重新计算高度;
814
				$(".loadtip").html('上拉加载更多');
815
				mySwiper.update();
797 816
			}
798 817
		},
799 818
		bindComEvent=function(){