小编gar*_*rgi的帖子

点击其他时更改Google地图标记图标

我使用高级自定义字段Google地图字段创建了Google地图多个位置页面.

我已设法在单击时更改标记图标,但我希望在单击其他图标时将其更改回来.

这是代码的一个例子:

    for (i = 0; i < locations.length; i++) {  
  marker = new google.maps.Marker({
    position: new google.maps.LatLng(locations[i][1], locations[i][2]),
    map: map,
    icon: iconBase + 'Stock%20Index%20Up.png'
  });

  google.maps.event.addListener(marker, 'click', (function(marker, i) {
    return function() {
      infowindow.setContent(locations[i][0], locations[i][6]);
      infowindow.open(map, marker);
      marker.setIcon("https://cdn3.iconfinder.com/data/icons/musthave/24/Stock%20Index%20Down.png");
    }
  })(marker, i));
Run Code Online (Sandbox Code Playgroud)

在这里更好地了解工作代码:http: //jsfiddle.net/gargiguy/s8vgxp3g

javascript google-maps-api-3 google-maps-markers advanced-custom-fields

7
推荐指数
1
解决办法
1万
查看次数

如何在屏幕上显示页脚时隐藏固定的DIV?

我有一个固定的侧边栏,在向下滚动时可以在页面上看到.

问题是 - 在某些情况下 - 边栏在到达页面底部时越过页脚.

当页脚在屏幕上可见时我想隐藏侧边栏以避免这种情况.我该怎么做?

html css jquery css3

3
推荐指数
1
解决办法
3642
查看次数