.on事件里面還有個.on 單擊時候總是逐次遞增 如何解決? ? tree.on("nodeselect", function (e) {? ? ? ? if (e.isLeaf) {? ? ? ? ? ? var id = e.node.id;? ? ? ? ? ? grid.load({id:id});? ? ? ? ? ? var latLng = new google.maps.LatLng(e.node.lat,e.node.lng);? ? ? ? ? ? tree.on("nodeclick", markerClickText(id,latLng));?? ? ? ? ? ? var div =map.getDiv();? ? ? ? ? ? map.setZoom(5);//縮放比例? ? ? ? ? ? map.panTo(latLng);? ? ? ? ? ? map.panBy(0, -(div.offsetHeight/4));//原有中心點向下偏移? ? ? ? ? ??? ? ? ? } else {? ? ? ? ? ? grid.setData([]);? ? ? ? ? ? grid.setTotalCount(0);? ? ? ? }? ? });
on()事件里套著on()事件 一直被遞增
ABOUTYOU
2019-03-07 13:14:21