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

I have the following code: function loadTweets() { $('#mainForm').submit(function(){ return false; }); $('#send').click(function(){ $('#tweets').html('');
Code: function Customer(name){ this._name=name; }; Customer.prototype.init=function(){ $('#SetCreditLevel').click(function(){ //best way to access this._name ? //this
Here is my code : function search_buddy() { $.post(num.php,function (ret){ num=ret; }); $(#Layer7).html(num); }
This code function LoadContent(Id) { alert('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id); $.get('Controls/Network/NetworkDetail.aspx?' +
View this code: function testprecision(){ var isNotNumber = parseFloat('1.3').toPrecision(6); alert(typeof isNotNumber); //=> string }
Say I have the following code: function One() {} One.prototype.x = undefined; function Two()
Is it like... var obj = new Object(); obj.function1 = function(){ //code } or
Given the following code,the hover function works correctly, but when clicked, loses the clicked_no_event_box
I have Designed the Javascript function My.js it contains following code My.js function display(){
I see a lot of code like this: function Base() {} function Sub() {}

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.