liyan 6 years ago
parent
commit
76730b640f
2 changed files with 10 additions and 4 deletions
  1. 4 4
      fund_h5_01/choose_city.html
  2. 6 0
      fund_h5_01/js/choice_city.js

+ 4 - 4
fund_h5_01/choose_city.html

75
     <script src="./js/tips.js?vv=4"></script>
75
     <script src="./js/tips.js?vv=4"></script>
76
     <script src="./js/city_picker.js?vv=10"></script>
76
     <script src="./js/city_picker.js?vv=10"></script>
77
     <script src="./js/choose_city.js?vv=12"></script>
77
     <script src="./js/choose_city.js?vv=12"></script>
78
-    <script src="./js/choice_city.js?v=11"></script>
78
+    <script src="./js/choice_city.js?v=12"></script>
79
 </body>
79
 </body>
80
 
80
 
81
 </html>
81
 </html>
82
 <script type="text/javascript">
82
 <script type="text/javascript">
83
 	$(".search input").focus(function () {
83
 	$(".search input").focus(function () {
84
 		if ($('html').scrollTop()) {
84
 		if ($('html').scrollTop()) {
85
-	        $('html').animate({ scrollTop: 0 }, 10);
85
+	        $('html').scrollTop(0);
86
 	        return false;
86
 	        return false;
87
 	    }
87
 	    }
88
-	    $('body').animate({ scrollTop: 0 }, 10);
88
+	    $('body').scrollTop(0);
89
 	})
89
 	})
90
-</script>
90
+</script>

+ 6 - 0
fund_h5_01/js/choice_city.js

53
 		var searchName = $("#search input").val().trim();
53
 		var searchName = $("#search input").val().trim();
54
 		var html = '';
54
 		var html = '';
55
 		if(searchName != ""){
55
 		if(searchName != ""){
56
+			if ($('html').scrollTop()) {
57
+				$('html').scrollTop(0);
58
+				return false;
59
+			    }
60
+			    $('body').scrollTop(0);
61
+
56
 			$("#search").removeClass("search");
62
 			$("#search").removeClass("search");
57
 			$("#search").addClass("search_02");
63
 			$("#search").addClass("search_02");
58
 			$(".searchBox").css({
64
 			$(".searchBox").css({