$(function(){ // start鼠标经过 $(".maparea_w").hover(function(){ $(this).addClass("cur").siblings().removeClass("cur"); },function(){ $(this).removeClass("cur"); }) //end map_show(); map_select(); map_cicle(); }) function map_show(){ // start 判断下拉是否和地图标点是否等值? 等值显示否则隐藏 for(i=0;i<$(".clityselect dd a").length;i++){ $(".mapcicle").each(function(){ if($(".clityselect dd a").eq(i).data("title")==$(this).data("title")){ $(this).parent().addClass("on") } }) } $(".maparea_w").hide(); $(".maparea_w.on").show(); // end } function map_select(){ //start右侧下拉赋值 $(".maparea_w.on").click(function(){ var d_title=$(this).find(".mapcicle").data("title"); $(this).addClass("on1").siblings().removeClass("on1"); $(".clityselect dt p").text(d_title); $(".clityselect dd a").each(function(){ if(d_title==$(this).data("title")){ $(".clityselect dt").attr({ "data-val": $(this).data("val") }); $("#province dd a").each(function () { var dd_title = $(this).attr("data-title"); if (dd_title == d_title) { $("#PublicSearch_Html").html(""); $(this).addClass("on").siblings().removeClass("on"); var iscatid = $(this).attr("data-catid"); var isportcity = $(this).attr("data-portcity"); var isport = $(this).attr("data-port"); //如果为栏目需要获取栏目下的城市 if (iscatid == 'true') { getcityAll(1); //获取只有接口中有该省份时的城市信息 } else if (isportcity == 'true') { getportcity(); } else if (isportcity == 'changzu') { getzhangzuData(); } else if (isport == 'true') { getportdata(); } else { zhuzhaiAll(1); } } }) } }) }) //end } function map_cicle(){ //start右侧下拉点击左侧地图圆圈显示 $(".clityselect dd a").click(function(){ var d_title02=$(this).data("title"); //console.log(d_title02) $(".maparea_w.on").each(function(){ $this=$(this); if(d_title02==$this.find(".mapcicle").data("title")){ $this.addClass("on1").siblings().removeClass("on1"); } }) }) //end // 圆圈默认值 $(".maparea_w.on").each(function(){ $this=$(this); if($(".clityselect dt p").text()==$this.find(".mapcicle").data("title")){ $this.addClass("on1").siblings().removeClass("on1"); } }) }