Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3498718
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:31:26+00:00 2026-05-18T12:31:26+00:00

The code is : function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, ‘click’, function() {

  • 0

The code is :

 function bindInfoWindow(marker, map, infoWindow, html) {                           
        google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent("<div id='window'>" + html + "</div>");
    } 

and

 var html = "<b>" + title + "</b> <br/><b>" + country;

and i want when country is UK or US to change the opacity of the #window div or the infoWindow

Is there a way i can do it with jQuery ?

thnx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:31:26+00:00Added an answer on May 18, 2026 at 12:31 pm

    You don’t really need jQuery to do this. In your css define an class with your desired opacity settings

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

    Modify your function to pass a country as a parameter and add the class to the div depending on the desired value

     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>");
            }
    

    or if you want to use 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>");
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Code: function Customer(name){ this._name=name; }; Customer.prototype.init=function(){ $('#SetCreditLevel').click(function(){ //best way to access this._name ? //this
This code function LoadContent(Id) { alert('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id); $.get('Controls/Network/NetworkDetail.aspx?' +
Javascript code: function doSomething(v1,v2){ //blah; } function SomeClass(callbackFunction,callbackFuncParameters(*Array*))={ this.callback = callbackFunction; this.method = function(){
The code: function updateDashboardData() { $.getJSON(includes/system/ajaxDataInterface.php, {recordcount:1}, function(data) { $('.stationContainer').each(function(data) { var bsID =
Updated code: function getElements() { var x=document.getElementsByTagName("option"); var el = document.getElementById('selectDept'); el.onmouseover = function(
PHP code: function compute_signature($key, $hash_string) { $digest = hash_hmac(sha1, $hash_string, $key, true); return base64_encode($digest);
Example Code: function flush_rewrite_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } function activate() { global $wp_rewrite;
my code- function create_id() { //global $myusername; $part1 = substr(Piyush, 0, -4); $part2 =
View this code: function testprecision(){ var isNotNumber = parseFloat('1.3').toPrecision(6); alert(typeof isNotNumber); //=> string }
I have the following code: function showAccessRequests_click() { var buttonValue = $(#showAccessRequests).val(); if (buttonValue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.