$(function(){ select(); }) function mapInt02(mapTitle,mapAdress,mapx,mapy){ var num = 0.002; var num2 = 0.0005; var map = new BMap.Map("map"); var point = new BMap.Point(mapx,mapy); var myIcon = new BMap.Icon("../images/address.png", new BMap.Size(31,40)); var marker2 = new BMap.Marker(point,{icon:myIcon}); map.addOverlay(marker2); if($(window).width()>1024){ map.centerAndZoom(point, 16); }else{ map.centerAndZoom(point, 16); } map.enableScrollWheelZoom(); map.enableContinuousZoom(); // if($(window).width()<1025){ // num = 0; // map.centerAndZoom(point2, 20); // } } function select(){ $(".year_select").each(function (i) { $(this).find("dt").click(function (e) { if($(this).hasClass('on_o')){ $(this).removeClass('on_o'); $(this).siblings().slideUp(200); }else{ $(this).addClass('on_o'); $(this).siblings().slideDown(200); } e.preventDefault(); e.stopPropagation() $(".year_select").eq(i).find("dd a").each(function (x) { $(this).click(function () { $(".year_select").eq(i).find("dt p").addClass("cur_p") $(".year_select").eq(i).find("dd a").removeClass("on"); $(this).addClass("on"); // $(".year_select").eq(i).find("dt p").text($(this).text()); // $(".year_select").eq(i).find("dt").attr({"data-val":$(this).data("val")}); }) }) }) }) // $(document).click(function () { // $(".year_select dd").slideUp(200); // $(".year_select dt").removeClass('on_o'); // }) $(".year_select dt").on("click", function(e){ $(this).parents(".year_select").siblings(".year_select").children("dd").slideUp(200); $(this).parents(".year_select").siblings(".year_select").children("dt").removeClass('on_o'); }); // 鑱旂郴鎴戜滑 setTimeout(function(){ $(".select01 dd a").eq(0).click(); setTimeout(function(){ $(".map_addresss li").eq(0).click(); },200) },200) $(".select01 dd a").click(function(){ $(this).addClass("on").siblings().removeClass("on"); var url = $(this).data("src"); if(url == ""){ return false; }else{ caseAjax2(".map_block",url) } }) } function caseAjax2(str,url){ if (url.indexOf('?') == -1) { url += '?tm=' + Math.random(); } else { url += '&tm=' + Math.random(); } $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); // 01 $(".map_addresss li").eq(0).click(); $(document).on("click",".map_addresss li",function(){ var mapx= $(this).attr("data-x"); var mapy= $(this).attr("data-y"); var titleText=$(".pub_year dt").text(); var titleAddress=$(".map_list li").eq(0).find("dd p").text(); mapInt02(titleText,titleAddress,mapx,mapy); }) // 01 setTimeout(function(){ if($(window).width()>1024){ ScollText(".map_block"); } },200) } }); }