2010-12-10 16 views
1
と不透明度を変更する情報ウィンドウ

コードがありますinfoWindowGoogleマップV3はjqueryの

私はjQueryでそれを行う方法はありますか?

thnx

答えて

0

これを行うにはjQueryは必要ありません。あなたのCSSで

.opacity { 
filter:alpha(opacity=50); //IE 

     opacity: 0.5; 

} 

パラメータとして国を通過して所望の値

function bindInfoWindow(marker, map, infoWindow, html, country) {       
      google.maps.event.addListener(marker, 'click', function() { 
    opacityClass = (country=="UK" || country == "US") ? "opacity" : ""; 

infoWindow.setContent("<div id='window' class="+opacityClass+">" + html + "</div>"); 
     } 

またはあなたの場合に応じて、div要素にクラスを追加するために、あなたの関数を変更し、ご希望の不透明度の設定でクラスを定義しますjqueryを使いたい

 function bindInfoWindow(marker, map, infoWindow, html, country) {       
       google.maps.event.addListener(marker, 'click', function() { 
     if (country=="UK" || country == "US") { 
$("#window").addClass("opacity") 
} 

    infoWindow.setContent("<div id='window'>" + html + "</div>"); 
      } 
関連する問題