JavaScript:全国城市数组[升级版]

说明

部分资料来自网上,若自行调用,一定要注意城市数组里面的部分下标为空的元素。

下面是源文件,自己整合测试一下就可以了.

html

queryhotelcitylist.js

城市数组.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
/****************
 @author:pruidong
 @date:2014.5.20
 @web:07q.net
***************/

//初始化各个城

var citysFlight=new Array();

citysFlight[0]=new Array('pek','北京','beijing','bj');

citysFlight[1]=new Array('can','广州','guangzhou','gz');

citysFlight[2]=new Array('szx','深圳','shenzhen','sz');

citysFlight[3]=new Array('csx','长沙','changsha','cs');

citysFlight[4]=new Array('ctu','成都','chengdu','cd');

citysFlight[5]=new Array('ckg','重庆','chongqing','cq');

citysFlight[6]=new Array('foc','福州','fuzhou','fz');

citysFlight[7]=new Array('kwe','贵阳','guiyang','gy');

citysFlight[8]=new Array('hak','海口','haikou','hk');

citysFlight[9]=new Array('hgh','杭州','hangzhou','hz');

citysFlight[10]=new Array('kmg','昆明','kunming','km');

citysFlight[11]=new Array('khn','南昌','nanchang','nc');

citysFlight[12]=new Array('nkg','南京','nanjing','nj');

citysFlight[13]=new Array('syx','三亚','sanya','sy');

citysFlight[14]=new Array('sha','上海虹桥','shanghaihongqiao','shhq');

citysFlight[15]=new Array('pvg','上海浦东','shanghaipudong','shpd');

citysFlight[16]=new Array('she','沈阳','shenyang','sy');

citysFlight[17]=new Array('wnz','温州','wenzhou','wz');

citysFlight[18]=new Array('wuh','武汉','wuhan','wh');

citysFlight[19]=new Array('xmn','厦门','xiamen','xm');

citysFlight[20]=new Array('sia','西安','xian','xa');

citysFlight[21]=new Array('cgo','郑州','zhengzhou','zz');

citysFlight[22]=new Array('swa','汕头','sangtou','st');

citysFlight[23]=new Array('tyn','太原','taiyuan','ty');

citysFlight[24]=new Array('tsn','天津','tianjin','tj');

citysFlight[25]=new Array('urc','乌鲁木齐','wulumuqi','wlmq');

citysFlight[26]=new Array('yiw','义乌','yiwu','yw');

citysFlight[27]=new Array('zha','湛江','zhanjiang','zj');

citysFlight[28]=new Array('cgo','长春','changchun','cc');

citysFlight[29]=new Array('dlc','大连','dalian','dl');

citysFlight[30]=new Array('kwl','桂林','guilin','gl');

citysFlight[31]=new Array('hrb','哈尔滨','haerbin','heb');

citysFlight[32]=new Array('hfe','合肥','hefei','hf');

citysFlight[33]=new Array('tna','济南','jinan','jn');

citysFlight[34]=new Array('nng','南宁','nanning','nn');

citysFlight[35]=new Array('ngb','宁波','ningbo','nb');

citysFlight[36]=new Array('tao','青岛','qingdao','qd');

citysFlight[37]=new Array('jmu','佳木斯','jiamusi','jms');

citysFlight[38]=new Array('mdg','牡丹江','mudanjiang','mdj');

citysFlight[39]=new Array('ynj','延吉','yanji','yj');

citysFlight[40]=new Array('het','呼和浩特','huhehaote','hhht');

//国际始发

citysFlight[41]=new Array('icn','首尔','shouer','se');

citysFlight[42]=new Array('cju','济州','jizhou','jz');

citysFlight[43]=new Array('pus','釜山','fushan','fs');

citysFlight[44]=new Array('tae','大邱','daqiu','dq');

citysFlight[45]=new Array('del','新德里','xindeli','xdl');

citysFlight[46]=new Array('kix','大阪','daban','db');

citysFlight[47]=new Array('ngo','名古屋','mingguwu','mgw');

citysFlight[48]=new Array('nrt','东京','dongjing','dj');

citysFlight[49]=new Array('fuk','福冈','fugang','fg');

citysFlight[50]=new Array('HKG','香港','xianggang','xg');

citysFlight[51]=new Array('TPE','台北','taibei','tb');   

citysFlight[52]=new Array('SIN','新加坡','xinjiapo','xjp'); 

citysFlight[53]=new Array('BKK','曼谷','mangu','mg');    

citysFlight[54]=new Array('JKT','雅加达','yajiada','yjd');

citysFlight[55]=new Array('KUL','吉隆坡','jilongpo','jlp'); 

citysFlight[56]=new Array('REP','暹粒','xianli','xl');       

citysFlight[57]=new Array('PNH','金边','jinbian','jb');      

citysFlight[58]=new Array('KTM','加德满都','jiademandu','jdmd');           

citysFlight[59]=new Array('SGN','胡志明','huzhiming','hzm');        

citysFlight[60]=new Array('HAN','河内','henei','hl');    

citysFlight[61]=new Array('MNL','马尼拉','manila','man');       

citysFlight[62]=new Array('RGN','仰光','yanguang','yg');         

citysFlight[63]=new Array('PEN','槟城','bincheng','bc');     

citysFlight[64]=new Array('MLE','马累','male','ml');         

citysFlight[65]=new Array('DEL','新德里','xindeli','xdl');              

citysFlight[66]=new Array('NRT','东京','dongjing','dj'); 

                   

citysFlight[67]=new Array('KIJ','新泻','xinxie','xx');

citysFlight[68]=new Array('TOY','富山','fushan','fs');   

citysFlight[69]=new Array('HIJ','广岛','guangdao','gd');     

citysFlight[70]=new Array('SDJ','仙台','xiantai','xt');          

citysFlight[71]=new Array('CTS','札幌','zhahuang','zh');     



citysFlight[72]=new Array('HKG','迪拜','dibai','db');        

citysFlight[73]=new Array('ALA','阿拉木图','alamitu','almt');              

citysFlight[74]=new Array('IKA','德黑兰','deheilan','dhl');                 

citysFlight[75]=new Array('ISB','伊斯兰堡','yisilanbao','yslb');                           

citysFlight[76]=new Array('FRU','比什凯克','bierkaike','bekk');                        

citysFlight[77]=new Array('ASB','阿什哈巴德','ashenhabade','ashbd');  

citysFlight[78]=new Array('BAK','巴库','baku','bk');                             

citysFlight[79]=new Array('VVO','海参崴','haishenwai','hsw');                               

citysFlight[80]=new Array('OVB','新西伯利亚','xinxiboliya','xxbly');                              

citysFlight[81]=new Array('DYU','杜尚别','dushangbie','dsb');                               

citysFlight[82]=new Array('OSS','奥什','aoshen','as');                               

citysFlight[83]=new Array('TAS','塔什干','tashengan','tsg');                            

citysFlight[84]=new Array('JED','吉达','jida','jd');                             

citysFlight[85]=new Array('DAC','达卡','daka','dk');                             

citysFlight[86]=new Array('SYD','悉尼','xini','xn');     

citysFlight[87]=new Array('BNE','布里斯班','bulisiban','blsb');    

citysFlight[88]=new Array('AKL','奥克兰','aokelan','akl');      

citysFlight[89]=new Array('CDG','巴黎','bali','bl');         

citysFlight[90]=new Array('AMS','阿姆斯特丹','amusitedan','amstd');       

citysFlight[91]=new Array('LAX','洛杉矶','luoshanji','lsj');    

citysFlight[92]=new Array('SVO','莫斯科','mosike','msk');           

citysFlight[93]=new Array('YVR','温哥华','wengehua','wgh');

//国内新增数据
/*********************************

        若自行调用时,一定要注意下面的空数组!!

***********************************/

citysFlight[94]=new Array("aldq","阿里地区","alidiqu","aldq");

citysFlight[95]=new Array("ales","阿拉尔","alaershi","ales");

citysFlight[96]=new Array("ays","安阳","anyangshi","ays");

citysFlight[97]=new Array("altdq","阿勒泰地区","aletaidiqu","altdq");

citysFlight[98]=new Array("aksdq","阿克苏地区","akesudiqu","aksdq");

citysFlight[99]=new Array("aqs","安庆","anqingshi","aqs");

citysFlight[100]=new Array("amtbxzq","澳门特别行政区","aomentebiexingzhengqu","amtbxzq");

citysFlight[101]=new Array("aks","安康","ankangshi","aks");

citysFlight[102]=new Array("ass","安顺","anshunshi","ass");

citysFlight[103]=new Array("ass","鞍山","anshanshi","ass");

citysFlight[104]=new Array("alsm","阿拉善盟","alashanmeng","alsm");

citysFlight[105]=new Array("abzzqzzzz","阿坝","abazangzuqiangzuzizhizhou","abzzqzzzz");

citysFlight[106]=new Array("","","","");

citysFlight[107]=new Array("","","","");

citysFlight[108]=new Array("bss","百色","baiseshi","bss");

citysFlight[109]=new Array("bzs","巴中","bazhongshi","bzs");

citysFlight[110]=new Array("bhs","北海","beihaishi","bhs");

citysFlight[111]=new Array("bjdq","毕节地区","bijiediqu","bjdq");

citysFlight[112]=new Array("bds","保定","baodingshi","bds");

citysFlight[113]=new Array("bzs","亳州","bozhoushi","bzs");

citysFlight[114]=new Array("bzs","滨州","binzhoushi","bzs");

citysFlight[115]=new Array("bxs","本溪","benxishi","bxs");

citysFlight[116]=new Array("bjs","宝鸡","baojishi","bjs");

citysFlight[117]=new Array("bynes","巴彦淖尔","bayannaoershi","bynes");

citysFlight[118]=new Array("byglmgzzz","巴音","bayinguolengmengguzizhizhou","byglmgzzz");

citysFlight[119]=new Array("bts","包头","baotoushi","bts");

citysFlight[120]=new Array("bbs","蚌埠","bengbushi","bbs");

citysFlight[121]=new Array("bss","白山","baishanshi","bss");

citysFlight[122]=new Array("bjs","北京","beijingshi","bjs");

citysFlight[123]=new Array("bss","保山","baoshanshi","bss");

citysFlight[124]=new Array("bcs","白城","baichengshi","bcs");

citysFlight[125]=new Array("bys","白银","baiyinshi","bys");

citysFlight[126]=new Array("betlmgzzz","博尔塔拉","boertalamengguzizhizhou","betlmgzzz");

citysFlight[127]=new Array("","","","");

citysFlight[128]=new Array("","","","");

citysFlight[129]=new Array("chs","巢湖","chaohushi","chs");

citysFlight[130]=new Array("cqs","重庆","chongqingshi","cqs");

citysFlight[131]=new Array("czs","沧州","cangzhoushi","czs");

citysFlight[132]=new Array("czs","潮州","chaozhoushi","czs");

citysFlight[133]=new Array("czs","郴州","chenzhoushi","czs");

citysFlight[134]=new Array("zys","朝阳","zhaoyangshi","zys");

citysFlight[135]=new Array("cds","承德","chengdeshi","cds");

citysFlight[136]=new Array("czs","滁州","chuzhoushi","czs");

citysFlight[137]=new Array("czs","常州","changzhoushi","czs");

citysFlight[138]=new Array("cds","常德","changdeshi","cds");

citysFlight[139]=new Array("cddq","昌都地区","changdoudiqu","cddq");

citysFlight[140]=new Array("czs","池州","chizhoushi","czs");

citysFlight[141]=new Array("cxyzzzz","楚雄","chuxiongyizuzizhizhou","cxyzzzz");

citysFlight[142]=new Array("cjhzzzz","昌吉","changjihuizuzizhizhou","cjhzzzz");

citysFlight[143]=new Array("cds","成都","chengdushi","cds");

citysFlight[144]=new Array("czs","崇左","chongzuoshi","czs");

citysFlight[145]=new Array("cfs","赤峰","chifengshi","cfs");

citysFlight[146]=new Array("","","","");

citysFlight[147]=new Array("","","","");

citysFlight[148]=new Array("dgs","东莞","dongguanshi","dgs");

citysFlight[149]=new Array("dds","丹东","dandongshi","dds");

citysFlight[150]=new Array("dxs","定西","dingxishi","dxs");

citysFlight[151]=new Array("dlbzzzz","大理","dalibaizuzizhizhou","dlbzzzz");

citysFlight[152]=new Array("dxaldq","大兴安岭地区","daxinganlingdiqu","dxaldq");

citysFlight[153]=new Array("dqzzzzz","迪庆藏族自治州","diqingzangzuzizhizhou","dqzzzzz");

citysFlight[154]=new Array("dzs","达州","dazhoushi","dzs");

citysFlight[155]=new Array("dys","德阳","deyangshi","dys");

citysFlight[156]=new Array("dzs","德州","dezhoushi","dzs");

citysFlight[157]=new Array("dhdzjpzzzz","德宏傣族景","dehongdaizujingpozuzizhizhou","dhdzjpzzzz");

citysFlight[158]=new Array("dys","东营","dongyingshi","dys");

citysFlight[159]=new Array("dqs","大庆","daqingshi","dqs");

citysFlight[160]=new Array("dts","大同","datongshi","dts");

citysFlight[161]=new Array("dls","大连","dalianshi","dls");

citysFlight[162]=new Array("","","","");

citysFlight[163]=new Array("","","","");

citysFlight[164]=new Array("estjzmzzzz","恩施","enshitujiazumiaozuzizhizhou","estjzmzzzz");

citysFlight[165]=new Array("eedss","鄂尔多斯","eerduosishi","eedss");

citysFlight[166]=new Array("ezs","鄂州","ezhoushi","ezs");

citysFlight[167]=new Array("","","","");

citysFlight[168]=new Array("","","","");

citysFlight[169]=new Array("fzs","福州","fuzhoushi","fzs");

citysFlight[170]=new Array("fxs","阜新","fuxinshi","fxs");

citysFlight[171]=new Array("fss","抚顺","fushunshi","fss");

citysFlight[172]=new Array("fys","阜阳","fuyangshi","fys");

citysFlight[173]=new Array("fzs","抚州","fuzhoushi","fzs");

citysFlight[174]=new Array("fcgs","防城港","fangchenggangshi","fcgs");

citysFlight[175]=new Array("fss","佛山","foshanshi","fss");

citysFlight[176]=new Array("","","","");

citysFlight[177]=new Array("","","","");

citysFlight[178]=new Array("gzs","赣州","ganzhoushi","gzs");

citysFlight[179]=new Array("gzs","广州","guangzhoushi","gzs");

citysFlight[180]=new Array("gys","贵阳","guiyangshi","gys");

citysFlight[181]=new Array("glzzzzz","果洛","guoluozangzuzizhizhou","glzzzzz");

citysFlight[182]=new Array("gys","固原","guyuanshi","gys");

citysFlight[183]=new Array("gls","桂林","guilinshi","gls");

citysFlight[184]=new Array("gas","广安","guanganshi","gas");

citysFlight[185]=new Array("gzzzzzz","甘孜","ganzizangzuzizhizhou","gzzzzzz");

citysFlight[186]=new Array("gys","广元","guangyuanshi","gys");

citysFlight[187]=new Array("ggs","贵港","guigangshi","ggs");

citysFlight[188]=new Array("gnzzzzz","甘南","gannanzangzuzizhizhou","gnzzzzz");

citysFlight[189]=new Array("","","","");

citysFlight[190]=new Array("","","","");

citysFlight[191]=new Array("hhs","怀化","huaihuashi","hhs");

citysFlight[192]=new Array("hfs","合肥","hefeishi","hfs");

citysFlight[193]=new Array("hgs","黄冈","huanggangshi","hgs");

citysFlight[194]=new Array("hlds","葫芦岛","huludaoshi","hlds");

citysFlight[195]=new Array("hmdq","哈密地区","hamidiqu","hmdq");

citysFlight[196]=new Array("hhhts","呼和浩特","huhehaoteshi","hhhts");

citysFlight[197]=new Array("has","淮安","huaianshi","has");

citysFlight[198]=new Array("hbs","鹤壁","hebishi","hbs");

citysFlight[199]=new Array("hzs","贺州","hezhoushi","hzs");

citysFlight[200]=new Array("hzs","荷泽","hezeshi","hzs");

citysFlight[201]=new Array("hebs","哈尔滨","haerbinshi","hebs");

citysFlight[202]=new Array("hbzzzzz","海北","haibeizangzuzizhizhou","hbzzzzz");

citysFlight[203]=new Array("hnzzzzz","海南","hainanzangzuzizhizhou","hnzzzzz");

citysFlight[204]=new Array("hzs","杭州","hangzhoushi","hzs");

citysFlight[205]=new Array("hnzzzzz","黄南","huangnanzangzuzizhizhou","hnzzzzz");

citysFlight[206]=new Array("htdq","和田地区","hetiandiqu","htdq");

citysFlight[207]=new Array("hxmgzzzzzz","海西","haiximengguzuzangzuzizhizhou","hxmgzzzzzz");

citysFlight[208]=new Array("hds","邯郸","handanshi","hds");

citysFlight[209]=new Array("hhhnzyzzzz","红河","honghehanizuyizuzizhizhou","hhhnzyzzzz");

citysFlight[210]=new Array("hcs","河池","hechishi","hcs");

citysFlight[211]=new Array("hgs","鹤岗","hegangshi","hgs");

citysFlight[212]=new Array("hss","衡水","hengshuishi","hss");

citysFlight[213]=new Array("hddq","海东地区","haidongdiqu","hddq");

citysFlight[214]=new Array("hks","海口","haikoushi","hks");

citysFlight[215]=new Array("hzs","湖州","huzhoushi","hzs");

citysFlight[216]=new Array("hss","黄山","huangshanshi","hss");

citysFlight[217]=new Array("hbs","淮北","huaibeishi","hbs");

citysFlight[218]=new Array("hlbes","呼伦贝尔","hulunbeiershi","hlbes");

citysFlight[219]=new Array("hys","衡阳","hengyangshi","hys");

citysFlight[220]=new Array("hns","淮南","huainanshi","hns");

citysFlight[221]=new Array("hhs","黑河","heiheshi","hhs");

citysFlight[222]=new Array("hzs","汉中","hanzhongshi","hzs");

citysFlight[223]=new Array("hys","河源","heyuanshi","hys");

citysFlight[224]=new Array("hzs","惠州","huizhoushi","hzs");

citysFlight[225]=new Array("hss","黄石","huangshishi","hss");

citysFlight[226]=new Array("","","","");

citysFlight[227]=new Array("","","","");

citysFlight[228]=new Array("jzs","锦州","jinzhoushi","jzs");

citysFlight[229]=new Array("jns","济南","jinanshi","jns");

citysFlight[230]=new Array("jns","济宁","jiningshi","jns");

citysFlight[231]=new Array("jjs","九江","jiujiangshi","jjs");

citysFlight[232]=new Array("jhs","金华","jinhuashi","jhs");

citysFlight[233]=new Array("jcs","金昌","jinchangshi","jcs");

citysFlight[234]=new Array("jxs","鸡西","jixishi","jxs");

citysFlight[235]=new Array("jms","江门","jiangmenshi","jms");

citysFlight[236]=new Array("jygs","嘉峪关","jiayuguanshi","jygs");

citysFlight[237]=new Array("jcs","晋城","jinchengshi","jcs");

citysFlight[238]=new Array("jxs","嘉兴","jiaxingshi","jxs");

citysFlight[239]=new Array("jdzs","景德镇","jingdezhenshi","jdzs");

citysFlight[240]=new Array("jmss","佳木斯","jiamusishi","jmss");

citysFlight[241]=new Array("jas","吉安","jianshi","jas");

citysFlight[242]=new Array("jzs","焦作","jiaozuoshi","jzs");

citysFlight[243]=new Array("jms","荆门","jingmenshi","jms");

citysFlight[244]=new Array("jys","揭阳","jieyangshi","jys");

citysFlight[245]=new Array("jls","吉林","jilinshi","jls");

citysFlight[246]=new Array("jqs","酒泉","jiuquanshi","jqs");

citysFlight[247]=new Array("jzs","晋中","jinzhongshi","jzs");

citysFlight[248]=new Array("jzs","荆州","jingzhoushi","jzs");

citysFlight[249]=new Array("","","","");

citysFlight[250]=new Array("","","","");

citysFlight[251]=new Array("kfs","开封","kaifengshi","kfs");

citysFlight[252]=new Array("klmys","克拉玛依","kelamayishi","klmys");

citysFlight[253]=new Array("kms","昆明","kunmingshi","kms");

citysFlight[254]=new Array("kzlskekzzzz","克孜勒苏柯尔克孜","kezilesukeerkezizizhizhou","kzlskekzzzz");

citysFlight[255]=new Array("ksdq","喀什地区","kashidiqu","ksdq");

citysFlight[256]=new Array("","","","");

citysFlight[257]=new Array("","","","");

citysFlight[258]=new Array("lss","拉萨","lasashi","lss");

citysFlight[259]=new Array("lygs","连云港","lianyungangshi","lygs");

citysFlight[260]=new Array("ljs","丽江","lijiangshi","ljs");

citysFlight[261]=new Array("lhs","漯河","luoheshi","lhs");

citysFlight[262]=new Array("lzs","兰州","lanzhoushi","lzs");

citysFlight[263]=new Array("las","六安","liuanshi","las");

citysFlight[264]=new Array("lzdq","林芝地区","linzhidiqu","lzdq");

citysFlight[265]=new Array("lys","辽源","liaoyuanshi","lys");

citysFlight[266]=new Array("lds","娄底","loudishi","lds");

citysFlight[267]=new Array("lfs","廊坊","langfangshi","lfs");

citysFlight[268]=new Array("lss","丽水","lishuishi","lss");

citysFlight[269]=new Array("lys","辽阳","liaoyangshi","lys");

citysFlight[270]=new Array("lys","临沂","linyishi","lys");

citysFlight[271]=new Array("lzs","柳州","liuzhoushi","lzs");

citysFlight[272]=new Array("lpss","六盘水","liupanshuishi","lpss");

citysFlight[273]=new Array("lys","洛阳","luoyangshi","lys");

citysFlight[274]=new Array("lns","陇南","longnanshi","lns");

citysFlight[275]=new Array("lsyzzzz","凉山","liangshanyizuzizhizhou","lsyzzzz");

citysFlight[276]=new Array("lcs","临沧","lincangshi","lcs");

citysFlight[277]=new Array("lxhzzzz","临夏","linxiahuizuzizhizhou","lxhzzzz");

citysFlight[278]=new Array("lcs","聊城","liaochengshi","lcs");

citysFlight[279]=new Array("lys","龙岩","longyanshi","lys");

citysFlight[280]=new Array("lfs","临汾","linfenshi","lfs");

citysFlight[281]=new Array("lls","吕梁","lvliangshi","lls");

citysFlight[282]=new Array("lzs","泸州","luzhoushi","lzs");

citysFlight[283]=new Array("lws","莱芜","laiwushi","lws");

citysFlight[284]=new Array("lss","乐山","leshanshi","lss");

citysFlight[285]=new Array("lbs","来宾","laibinshi","lbs");

citysFlight[286]=new Array("","","","");

citysFlight[287]=new Array("","","","");

citysFlight[288]=new Array("mass","马鞍山","maanshanshi","mass");

citysFlight[289]=new Array("mms","茂名","maomingshi","mms");

citysFlight[290]=new Array("mys","绵阳","mianyangshi","mys");

citysFlight[291]=new Array("mss","眉山","meishanshi","mss");

citysFlight[292]=new Array("mzs","梅州","meizhoushi","mzs");

citysFlight[293]=new Array("mdjs","牡丹江","mudanjiangshi","mdjs");

citysFlight[294]=new Array("","","","");

citysFlight[295]=new Array("","","","");

citysFlight[296]=new Array("nps","南平","nanpingshi","nps");

citysFlight[297]=new Array("nds","宁德","ningdeshi","nds");

citysFlight[298]=new Array("ncs","南昌","nanchangshi","ncs");

citysFlight[299]=new Array("nts","南通","nantongshi","nts");

citysFlight[300]=new Array("njs","南京","nanjingshi","njs");

citysFlight[301]=new Array("nys","南阳","nanyangshi","nys");

citysFlight[302]=new Array("nns","南宁","nanningshi","nns");

citysFlight[303]=new Array("njlszzzz","怒江","nujianglisuzuzizhizhou","njlszzzz");

citysFlight[304]=new Array("njs","内江","neijiangshi","njs");

citysFlight[305]=new Array("nbs","宁波","ningboshi","nbs");

citysFlight[306]=new Array("nqdq","那曲地区","naqudiqu","nqdq");

citysFlight[307]=new Array("ncs","南充","nanchongshi","ncs");

citysFlight[308]=new Array("","","","");

citysFlight[309]=new Array("","","","");

citysFlight[310]=new Array("pxs","萍乡","pingxiangshi","pxs");

citysFlight[311]=new Array("pls","平凉","pingliangshi","pls");

citysFlight[312]=new Array("pzhs","攀枝花","panzhihuashi","pzhs");

citysFlight[313]=new Array("pys","濮阳","puyangshi","pys");

citysFlight[314]=new Array("pjs","盘锦","panjinshi","pjs");

citysFlight[315]=new Array("pts","莆田","putianshi","pts");

citysFlight[316]=new Array("pdss","平顶山","pingdingshanshi","pdss");

citysFlight[317]=new Array("","","","");

citysFlight[318]=new Array("","","","");

citysFlight[319]=new Array("qzs","钦州","qinzhoushi","qzs");

citysFlight[320]=new Array("qzs","衢州","quzhoushi","qzs");

citysFlight[321]=new Array("qys","清远","qingyuanshi","qys");

citysFlight[322]=new Array("qqhes","齐齐哈尔","qiqihaershi","qqhes");

citysFlight[323]=new Array("qnbyzmzzzz","黔南","qiannanbuyizumiaozuzizhizhou","qnbyzmzzzz");

citysFlight[324]=new Array("qths","七台河","qitaiheshi","qths");

citysFlight[325]=new Array("qds","青岛","qingdaoshi","qds");

citysFlight[326]=new Array("qdnmzdzzzz","黔东南","qiandongnanmiaozudongzuzizhizhou","qdnmzdzzzz");

citysFlight[327]=new Array("qhds","秦皇岛","qinhuangdaoshi","qhds");

citysFlight[328]=new Array("qys","庆阳","qingyangshi","qys");

citysFlight[329]=new Array("qxnbyzmzzzz","黔西南","qianxinanbuyizumiaozuzizhizhou","qxnbyzmzzzz");

citysFlight[330]=new Array("qjs","曲靖","qujingshi","qjs");

citysFlight[331]=new Array("qzs","泉州","quanzhoushi","qzs");

citysFlight[332]=new Array("","","","");

citysFlight[333]=new Array("","","","");

citysFlight[334]=new Array("rzs","日照","rizhaoshi","rzs");

citysFlight[335]=new Array("rkzdq","日喀则地区","rikazediqu","rkzdq");

citysFlight[336]=new Array("","","","");

citysFlight[337]=new Array("","","","");

citysFlight[338]=new Array("sgs","韶关","shaoguanshi","sgs");

citysFlight[339]=new Array("shzs","石河子","shihezishi","shzs");

citysFlight[340]=new Array("sndq","山南地区","shannandiqu","sndq");

citysFlight[341]=new Array("szss","石嘴山","shizuishanshi","szss");

citysFlight[342]=new Array("syss","双鸭山","shuangyashanshi","syss");

citysFlight[343]=new Array("szs","深圳","shenzhenshi","szs");

citysFlight[344]=new Array("sms","三明","sanmingshi","sms");

citysFlight[345]=new Array("shs","上海","shanghaishi","shs");

citysFlight[346]=new Array("sxs","绍兴","shaoxingshi","sxs");

citysFlight[347]=new Array("shs","绥化","suihuashi","shs");

citysFlight[348]=new Array("szs","苏州","suzhoushi","szs");

citysFlight[349]=new Array("szs","宿州","suzhoushi","szs");

citysFlight[350]=new Array("snj","神农架","shennongjia","snj");

citysFlight[351]=new Array("sys","邵阳","shaoyangshi","sys");

citysFlight[352]=new Array("sys","十堰","shiyanshi","sys");

citysFlight[353]=new Array("sws","汕尾","shanweishi","sws");

citysFlight[354]=new Array("srs","上饶","shangraoshi","srs");

citysFlight[355]=new Array("sps","四平","sipingshi","sps");

citysFlight[356]=new Array("sjzs","石家庄","shijiazhuangshi","sjzs");

citysFlight[357]=new Array("szs","随州","suizhoushi","szs");

citysFlight[358]=new Array("smxs","三门峡","sanmenxiashi","smxs");

citysFlight[359]=new Array("sts","汕头","shantoushi","sts");

citysFlight[360]=new Array("sns","遂宁","suiningshi","sns");

citysFlight[361]=new Array("sqs","商丘","shangqiushi","sqs");

citysFlight[362]=new Array("szs","朔州","shuozhoushi","szs");

citysFlight[363]=new Array("sms","思茅","simaoshi","sms");

citysFlight[364]=new Array("sys","沈阳","shenyangshi","sys");

citysFlight[365]=new Array("sls","商洛","shangluoshi","sls");

citysFlight[366]=new Array("sys","三亚","sanyashi","sys");

citysFlight[367]=new Array("sqs","宿迁","suqianshi","sqs");

citysFlight[368]=new Array("sys","松原","songyuanshi","sys");

citysFlight[369]=new Array("xms","厦门","xiamenshi","xms");

citysFlight[370]=new Array("","","","");

citysFlight[371]=new Array("","","","");

citysFlight[372]=new Array("tys","太原","taiyuanshi","tys");

citysFlight[373]=new Array("tmsks","图木舒克","tumushukeshi","tmsks");

citysFlight[374]=new Array("tls","通辽","tongliaoshi","tls");

citysFlight[375]=new Array("tcdq","塔城地区","tachengdiqu","tcdq");

citysFlight[376]=new Array("tlfdq","吐鲁番地区","tulufandiqu","tlfdq");

citysFlight[377]=new Array("tzs","泰州","taizhoushi","tzs");

citysFlight[378]=new Array("ths","通化","tonghuashi","ths");

citysFlight[379]=new Array("tzs","台州","taizhoushi","tzs");

citysFlight[380]=new Array("tls","铜陵","tonglingshi","tls");

citysFlight[381]=new Array("tjs","天津","tianjinshi","tjs");

citysFlight[382]=new Array("tls","铁岭","tielingshi","tls");

citysFlight[383]=new Array("tcs","铜川","tongchuanshi","tcs");

citysFlight[384]=new Array("tas","泰安","taianshi","tas");

citysFlight[385]=new Array("tss","唐山","tangshanshi","tss");

citysFlight[386]=new Array("trdq","铜仁地区","tongrendiqu","trdq");

citysFlight[387]=new Array("tss","天水","tianshuishi","tss");

citysFlight[388]=new Array("tws","台湾省","taiwansheng","tws");

citysFlight[389]=new Array("","","","");

citysFlight[390]=new Array("","","","");

citysFlight[391]=new Array("wzs","温州","wenzhoushi","wzs");

citysFlight[392]=new Array("whs","武汉","wuhanshi","whs");

citysFlight[393]=new Array("wws","武威","wuweishi","wws");

citysFlight[394]=new Array("wlmqs","乌鲁木齐","wulumuqishi","wlmqs");

citysFlight[395]=new Array("wjqs","五家渠","wujiaqushi","wjqs");

citysFlight[396]=new Array("whs","威海","weihaishi","whs");

citysFlight[397]=new Array("whs","芜湖","wuhushi","whs");

citysFlight[398]=new Array("wzs","梧州","wuzhoushi","wzs");

citysFlight[399]=new Array("wxs","无锡","wuxishi","wxs");

citysFlight[400]=new Array("whs","乌海","wuhaishi","whs");

citysFlight[401]=new Array("wfs","潍坊","weifangshi","wfs");

citysFlight[402]=new Array("wzs","吴忠","wuzhongshi","wzs");

citysFlight[403]=new Array("wlcbs","乌兰察布","wulanchabushi","wlcbs");

citysFlight[404]=new Array("wns","渭南","weinanshi","wns");

citysFlight[405]=new Array("wszzmzzzz","文山","wenshanzhuangzumiaozuzizhizhou","wszzmzzzz");

citysFlight[406]=new Array("","","","");

citysFlight[407]=new Array("","","","");

citysFlight[408]=new Array("xts","湘潭","xiangtanshi","xts");

citysFlight[409]=new Array("xlglm","锡林郭勒盟","xilinguolemeng","xlglm");

citysFlight[410]=new Array("xzs","徐州","xuzhoushi","xzs");

citysFlight[411]=new Array("xzs","忻州","xinzhoushi","xzs");

citysFlight[412]=new Array("xfs","襄樊","xiangfanshi","xfs");

citysFlight[413]=new Array("xys","信阳","xinyangshi","xys");

citysFlight[414]=new Array("xas","西安","xianshi","xas");

citysFlight[415]=new Array("xxs","新乡","xinxiangshi","xxs");

citysFlight[416]=new Array("xxtjzmzzzz","湘西","xiangxitujiazumiaozuzizhizhou","xxtjzmzzzz");

citysFlight[417]=new Array("xts","邢台","xingtaishi","xts");

citysFlight[418]=new Array("xys","新余","xinyushi","xys");

citysFlight[419]=new Array("xam","兴安盟","xinganmeng","xam");

citysFlight[420]=new Array("xcs","许昌","xuchangshi","xcs");

citysFlight[421]=new Array("xcs","宣城","xuanchengshi","xcs");

citysFlight[422]=new Array("xgs","孝感","xiaoganshi","xgs");

citysFlight[423]=new Array("xns","西宁","xiningshi","xns");

citysFlight[424]=new Array("xys","咸阳","xianyangshi","xys");

citysFlight[425]=new Array("xns","咸宁","xianningshi","xns");

citysFlight[426]=new Array("xgtbxzq","香港特别行政区","xianggangtebiexingzhengqu","xgtbxzq");

citysFlight[427]=new Array("xsbndzzzz","西双版纳","xishuangbannadaizuzizhizhou","xsbndzzzz");

citysFlight[428]=new Array("","","","");

citysFlight[429]=new Array("","","","");

citysFlight[430]=new Array("ycs","宜昌","yichangshi","ycs");

citysFlight[431]=new Array("ycs","伊春","yichunshi","ycs");

citysFlight[432]=new Array("yas","雅安","yaanshi","yas");

citysFlight[433]=new Array("ycs","宜春","yichunshi","ycs");

citysFlight[434]=new Array("yszzzzz","玉树藏族自治州","yushuzangzuzizhizhou","yszzzzz");

citysFlight[435]=new Array("ycs","盐城","yanchengshi","ycs");

citysFlight[436]=new Array("yts","烟台","yantaishi","yts");

citysFlight[437]=new Array("yts","鹰潭","yingtanshi","yts");

citysFlight[438]=new Array("yzs","扬州","yangzhoushi","yzs");

citysFlight[439]=new Array("yks","营口","yingkoushi","yks");

citysFlight[440]=new Array("ycs","银川","yinchuanshi","ycs");

citysFlight[441]=new Array("ycs","运城","yunchengshi","ycs");

citysFlight[442]=new Array("yys","益阳","yiyangshi","yys");

citysFlight[443]=new Array("yls","玉林","yulinshi","yls");

citysFlight[444]=new Array("yqs","阳泉","yangquanshi","yqs");

citysFlight[445]=new Array("yjs","阳江","yangjiangshi","yjs");

citysFlight[446]=new Array("ybcxzzzz","延边","yanbianchaoxianzuzizhizhou","ybcxzzzz");

citysFlight[447]=new Array("yxs","玉溪","yuxishi","yxs");

citysFlight[448]=new Array("ybs","宜宾","yibinshi","ybs");

citysFlight[449]=new Array("yfs","云浮","yunfushi","yfs");

citysFlight[450]=new Array("yzs","永州","yongzhoushi","yzs");

citysFlight[451]=new Array("yys","岳阳","yueyangshi","yys");

citysFlight[452]=new Array("yls","榆林","yulinshi","yls");

citysFlight[453]=new Array("yas","延安","yananshi","yas");

citysFlight[454]=new Array("ylhskzzz","伊犁","yilihasakezizhizhou","ylhskzzz");

citysFlight[455]=new Array("","","","");

citysFlight[456]=new Array("","","","");

citysFlight[457]=new Array("zjjs","张家界","zhangjiajieshi","zjjs");

citysFlight[458]=new Array("czs","长治","changzhishi","czs");

citysFlight[459]=new Array("zjs","湛江","zhanjiangshi","zjs");

citysFlight[460]=new Array("zss","中山","zhongshanshi","zss");

citysFlight[461]=new Array("zmds","驻马店","zhumadianshi","zmds");

citysFlight[462]=new Array("zqs","肇庆","zhaoqingshi","zqs");

citysFlight[463]=new Array("ccs","长春","changchunshi","ccs");

citysFlight[464]=new Array("zbs","淄博","ziboshi","zbs");

citysFlight[465]=new Array("zss","舟山","zhoushanshi","zss");

citysFlight[466]=new Array("zgs","自贡","zigongshi","zgs");

citysFlight[467]=new Array("zys","资阳","ziyangshi","zys");

citysFlight[468]=new Array("zhs","珠海","zhuhaishi","zhs");

citysFlight[469]=new Array("zks","周口","zhoukoushi","zks");

citysFlight[470]=new Array("zys","张掖","zhangyeshi","zys");

citysFlight[471]=new Array("zzs","郑州","zhengzhoushi","zzs");

citysFlight[472]=new Array("zys","遵义","zunyishi","zys");

citysFlight[473]=new Array("css","长沙","changshashi","css");

citysFlight[474]=new Array("zzs","株洲","zhuzhoushi","zzs");

citysFlight[475]=new Array("zzs","漳州","zhangzhoushi","zzs");

citysFlight[476]=new Array("zzs","枣庄","zaozhuangshi","zzs");

citysFlight[477]=new Array("zts","昭通","zhaotongshi","zts");

citysFlight[478]=new Array("zws","中卫","zhongweishi","zws");

citysFlight[479]=new Array("zjks","张家口","zhangjiakoushi","zjks");

citysFlight[480]=new Array("zjs","镇江","zhenjiangshi","zjs");

queryticketcity.js

城市操作js.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
(function($){
        //城市操作js.

    $.querycity = function(input,options){

        var input = $(".choosesetout");//触发城市选择框.可以是按钮.

        var sousuo = $(".Sousuocity");//城市返回框.

        input.attr('autocomplete','off');

       

        /*

        if($.trim(input.val())=='' || $.trim(input.val())==options.defaultText){

            input.val(options.defaultText).css('color','#aaa');

        }

        */

        var t_pop_focus = false;

        var t_suggest_focus = false;

        var t_suggest_page_click = false;//display:none

        $('body').append("<div id='pop_city_"+input.attr('id')+"' class='pop_city' style='display:none'><p class='pop_head'></p><ul class='list_label'></ul><div class='pop_city_container'></div></div>");

        $('body').append("<div id='suggest_city_"+input.attr('id')+"' class='list_city' style='display:none'><div class='list_city_head'></div><div class='list_city_container'></div><div class='page_break'></div></div>");

        var popMain = $("#pop_city_"+input.attr('id'))

        var popContainer = popMain.find('.pop_city_container');

        var labelMain = popMain.find('.list_label');

        var suggestMain = $("#suggest_city_"+input.attr('id'));

        popMain.bgIframe();

        suggestMain.bgIframe();

        popInit();

        resetPosition();        

       

        $(window).resize(function(){

            resetPosition();

        });        

       

        input.focus(function(){

            if(t_suggest_page_click){

                t_suggest_page_click = false;

                return true;

            }

            suggestMain.hide();

            if($.trim($(this).val())==options.defaultText){

                $(this).val('').css('color','#000');

            }

            popMain.show();

        }).click(function(){       

            if(t_suggest_page_click){

                t_suggest_page_click = false;

                return;

            }

            suggestMain.hide();

            popMain.show();    

        }).blur(function(){            

            if(t_pop_focus == false){

                popMain.hide();            

                if($.trim(input.val())=='' || $.trim(input.val())==options.defaultText){               

                    input.val(options.defaultText).css('color','#aaa');

                }

            }

        });

        labelMain.find('a').live('click',function(){   

            input.focus();//使焦点在输入框,避免blur事件无法触发

            t_pop_focus = true;

            var labelId = $(this).attr('id');

            labelMain.find('li a').removeClass('current');

            $(this).addClass('current');

            popContainer.find('ul').hide();

            $("#"+labelId+'_container').show();

           

        });

        popContainer.find('a').live('click',function(){

           

            input.text($(this).html());//将城市加载到元素

            sousuo.val($(this).html());//将城市加载到元素.

            //alert($(this).html());//输出选择城市

            /////////////////////////////

            popMain.hide();

        });

        popMain.mouseover(function(){  

            t_pop_focus = true;

        }).mouseout(function(){

            t_pop_focus = false;

        });



        input.blur(function(){

            if( t_suggest_focus == false ){

                if($(this).val()==''){

                    $(this).val( suggestMain.find('.list_city_container a.selected').children('b').text());

                }

            suggestMain.hide();

            }

        }).keydown(function(event){

            popMain.hide();

            event = window.event || event;

            var keyCode = event.keyCode || event.which || event.charCode;      

            if (keyCode == 37) {//左

                prevPage();    

            } else if (keyCode == 39) {//右

                nextPage();

            }else if(keyCode == 38){//上

                prevResult();

            }else if(keyCode == 40){//下

                 nextResult();

            }

        }).keypress(function(event){

            event = window.event || event;

            var keyCode = event.keyCode || event.which || event.charCode;

            if(13 == keyCode){

                if(suggestMain.find('.list_city_container a.selected').length > 0){

                    input.val(suggestMain.find('.list_city_container a.selected').children('b').text());

                    suggestMain.hide();

                }

            }

        }).keyup(function(event){

            event = window.event || event;

            var keyCode = event.keyCode || event.which || event.charCode;        

            if(keyCode != 13 && keyCode != 37 && keyCode != 39 && keyCode !=9 && keyCode !=38 && keyCode !=40 ){

                //keyCode == 9是tab切换键

                queryCity();

            }

        });

     

        suggestMain.find('.list_city_container a').live('click',function(){

            input.val($(this).children('b').text());

            suggestMain.hide();

           

        }).live('mouseover',function(){

            t_suggest_focus = true;        

        }).live('mouseout',function(){

            t_suggest_focus = false;

        });

        suggestMain.find('.page_break a').live('mouseover',function(){

            t_suggest_focus = true;        

        }).live('mouseout',function(){

            t_suggest_focus = false;

        });

        suggestMain.find('.page_break a').live('click',function(event){

            t_suggest_page_click = true;

            input.click();

            if($(this).attr('inum') != null){

                setAddPage($(this).attr('inum'));

            }

        });



        function nextPage(){

              var add_cur= suggestMain.find(".page_break a.current").next();

                if (add_cur != null) {                

                    if ($(add_cur).attr("inum") != null) {

                        setAddPage($(add_cur).attr("inum"));

                    }

                }

        }

        function prevPage(){

                var add_cur = suggestMain.find(".page_break a.current").prev();

                if (add_cur != null) {

                    if ($(add_cur).attr("inum") != null) {

                        setAddPage($(add_cur).attr("inum"));

                    }

                }

        }

        function nextResult(){

                  var t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a.selected')[0]);

                    suggestMain.find('.list_city_container').children().removeClass('selected');          

                    t_index += 1;

                    var t_end =  suggestMain.find('.list_city_container a').index( suggestMain.find('.list_city_container a:visible').filter(':last')[0]);

                    if(t_index > t_end ){

                        t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').eq(0));

                    }

                    suggestMain.find('.list_city_container a').eq(t_index).addClass('selected');

        }

        function prevResult(){

                 

                     var t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a.selected')[0]);

                suggestMain.find('.list_city_container').children().removeClass('selected');

                t_index -= 1;

                var t_start = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').filter(':first')[0]);

                if( t_index < t_start){

                    t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').filter(':last')[0]);

                }

                suggestMain.find('.list_city_container a').eq(t_index).addClass('selected');      

        }

        function loadCity(){       

            var cityList = suggestMain.find('.list_city_container');       

            cityList.empty();

            if(options.hotList){

                var hotList = options.hotList;

            }else{

                var hotList = [0,1,2,3,4,5,6,7,8,9];

            }

            for(var item in hotList){

                if(item>options.suggestLength){

                    return;

                }

                var _data = options.data[hotList[item]];

                cityList.append("<a href='javascript:void(0)' ><span>"+_data[2]+"</span><b>"+_data[1]+"</b></a>");

            }      

            suggestMain.find('.list_city_head').html(options.suggestTitleText);

            setAddPage(1);

            suggestMain.show();

            setTopSelect();

        }

        function queryCity(){

            popMain.hide();

            var value = input.val().toLowerCase();

            if( value.length == 0){

                loadCity();

                return;

            }

            var city_container = suggestMain.find('.list_city_container');        

            var isHave = false;

            var _tmp = new Array();

            for(var item in options.data){         

                var _data = options.data[item];    

                if(typeof (_data) != 'undefined'){

                    if(_data[2].indexOf(value) >= 0 || _data[3].indexOf(value) >= 0 || _data[1].indexOf(value) >=0 || _data[0].indexOf(value) >=0 ){                                       

                        isHave = true;

                        _tmp.push(_data);

                    }

                }

             }

;

            if(isHave){

                city_container.empty();

                for(var item in _tmp){

                var _data= _tmp[item];

                city_container.append("<a href='javascript:void(0)' style='display:none'><span>"+_data[2]+"</span><b>"+     _data[1] +"</b></a>");                

                }

                suggestMain.find('.list_city_head').html(value+",按拼音排序");

                setAddPage(1);

                setTopSelect()

            }else{

                suggestMain.find('.list_city_head').html("<span class='msg'>对不起,找不到"+value+"</span>");

            }

            suggestMain.show();

        }

        function setAddPage(pageIndex){

            suggestMain.find('.list_city_container a').removeClass('selected');

            suggestMain.find('.list_city_container').children().each(function(i){          

                var k = i+1;

                if(k> options.suggestLength*(pageIndex-1) && k <= options.suggestLength*pageIndex){

                    $(this).css('display','block');

                }else{

                    $(this).hide();    

                }

             });

            setTopSelect();

            setAddPageHtml(pageIndex);

        }

        function setAddPageHtml(pageIndex){

            var cityPageBreak = suggestMain.find('.page_break');

            cityPageBreak.empty(); 

            if(suggestMain.find('.list_city_container').children().length > options.suggestLength){

                var pageBreakSize = Math.ceil(suggestMain.find('.list_city_container').children().length/options.suggestLength);   

                if(pageBreakSize <= 1){

                    return;

                }          

                var start = end = pageIndex;

                for(var index = 0 ,num = 1 ; index < options.pageLength && num < options.pageLength; index++){

                    if(start > 1){

                        start--;num++;

                    }

                    if(end<pageBreakSize){

                        end ++;num++;

                    }

                }

                if(pageIndex > 1){

                    cityPageBreak.append("<a href='javascript:void(0)' inum='"+(pageIndex-1)+"'>&lt;-</a>");

                }  

                for(var i=start;i<=end;i++){

                    if(i == pageIndex){

                        cityPageBreak.append("<a href='javascript:void(0)' class='current' inum='"+(i)+"'>"+(i)+"</a");

                    }else{

                        cityPageBreak.append("<a href='javascript:void(0)' inum='"+(i)+"'>"+(i)+"</a");

                    }        

             }        

                if (pageIndex<pageBreakSize) {

                    cityPageBreak.append("<a href='javascript:void(0);' inum='"+ (i) +"'>-&gt;</a>");

                }

                cityPageBreak.show();          

            }else{

                cityPageBreak.hide();    

            }

            return;

        }

        function setTopSelect(){       

            if(suggestMain.find('.list_city_container').children().length > 0 ){

                suggestMain.find('.list_city_container').children(':visible').eq(0).addClass('selected');

            }

        }

        function onSelect(){

            if( typeof options.onSelect == 'function'){

                alert(1);

            }

        }

        function popInit(){

            var index = 0;

            popMain.find('.pop_head').html(options.popTitleText);

            if(!options.tabs){

                popContainer.append("<ul id='label_"+input.attr('id')+"_container' class='current'></ul>");

                labelMain.remove();

                for( var item in options.data){

                      $("#label_"+input.attr('id')+"_container").append("<li><a href='javascript:void(0)'>"+options.data[item][1]+"</a></li>");

                }

                return;

            }

            for(var itemLabel in options.tabs){    

                index++;           

                if(index == 1){

                    popContainer.append("<ul id='label_"+input.attr('id')+index+"_container' class='current' data-type='"+itemLabel+"'></ul>");

                    labelMain.append("<li><a id='label_"+input.attr('id')+index+"' class='current' href='javascript:void(0)'>"+itemLabel+"</a></li>");     

                }else{

                    popContainer.append("<ul style='display:none' id='label_"+input.attr('id')+index+"_container' data-type='"+itemLabel+"'></ul>");

                    labelMain.append("<li><a id='label_"+input.attr('id')+index+"' href='javascript:void(0)'>"+itemLabel+"</a></li>");     

                }

                for(var item in options.tabs[itemLabel]){

                    var cityCode = options.tabs[itemLabel][item];

                    if(!options.data[cityCode]){

                        break;

                    }              

                    $("#label_"+input.attr('id')+index+"_container").append("<li><a href='javascript:void(0)'>"+options.data[cityCode][1]+"</a></li>");

                }

            }          

        }

        function resetPosition(){

            popMain.css({'top':input.position().top+input.outerHeight()+203,'left':input.position().left+192});

            suggestMain.css({'top':input.position().top+input.outerHeight()+203,'left':input.position().left+192});

        }

    }

    $.fn.querycity = function(options){

        var defaults = {

            'data'          : {},

            'tabs'          : '',

            'hotList'       : '',            

            'defaultText'   : '中文/拼音',

            'popTitleText'  : '请选择城市或输入城市名称的拼音或英文<a style=margin-left:100px;font-weight:bold;color:#FFF;font-size:20px; href=javascript:void(0); onclick=javascript:document.getElementById("pop_city_city").style.display="none";>×</a>',

            'suggestTitleText' : '输入中文/拼音或↑↓选择',

            'suggestLength' : 10,

            'pageLength'    : 0,

            'onSelect'      : ''

        };

        var options = $.extend(defaults,options);

        this.each(function(){

            new $.querycity(this,options);            

        });

        return this;

    };



})(jQuery);





(function($){

$.fn.bgIframe = $.fn.bgiframe = function(s) {

    if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) {

        s = $.extend({

            top     : 'auto', // auto == .currentStyle.borderTopWidth

            left    : 'auto', // auto == .currentStyle.borderLeftWidth

            width   : 'auto', // auto == offsetWidth

            height  : 'auto', // auto == offsetHeight

            opacity : true,

            src     : 'javascript:false;'

        }, s || {});

        var prop = function(n){return n&&n.constructor==Number?n+'px':n;},

            html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+

                       'style="display:block;position:absolute;z-index:-1;'+

                           (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+

                           'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+

                           'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+

                           'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+

                           'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+

                    '"/>';

        return this.each(function() {

            if ( $('> iframe.bgiframe', this).length == 0 )

                //this.insertBefore( document.createElement(html), this.firstChild );

                this.insertBefore( createElementByHtml(html), this.firstChild );

        });

    }

    return this;

};



function createElementByHtml(htmlStr) {

    //如果只是根据标签名称(tagName)来创建元素,直接就好

    if (htmlStr.indexOf("<") == -1) {

        return document.createElement(htmlStr);

    }

    var $obj = $(htmlStr);

    return $obj.get(0);

}



})(jQuery);

tmp.html

下面的代码放在HTML页面里面,一定要引入Jquery的库!切记!!

1
2
3
4
5
6
7
8
9
10
11
12
13
//放在jquery里面.

 var labelFromcity = new Array();
    labelFromcity ['热门城市'] = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40);
    labelFromcity ['A-F'] = new Array(0,3,4,5,6,28,29,93,94,95,96,97,98,99,100,101,102,103,104,105,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,148,149,150,151,152,153,154,155,156,157,158,159,160,161,164,165,166,169,170,171,172,173,174,175);
    labelFromcity ['G-J'] = new Array(1,7,8,9,30,31,32,33,37,40,178,179,180,181,182,183,184,185,186,187,188,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248);
    labelFromcity ['K-N'] = new Array(10,11,12,34,35,38,251,252,253,254,255,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,288,289,290,291,292,293,296,297,298,299,300,301,302,303,304,305,306,307);
    labelFromcity ['P-W'] = new Array(13,14,15,16,17,18,22,24,25,36,310,311,312,313,314,315,316,319,320,321,322,323,324,325,326,327,328,329,330,331,334,335,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405);
    labelFromcity ['X-Z'] = new Array(2,19,20,21,26,27,39,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480);
    //labelFromcity ['国际城市'] = new Array(41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93);
    var hotList = new Array(0,1,2,3,4,5,6);

$(".choosesetout").querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});//.choosesetout修改成你自己的元素类名.

发表评论

您的电子邮箱地址不会被公开。

*

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据