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 3276746
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:17:33+00:00 2026-05-17T19:17:33+00:00

I’ve been trying to tackle this problem for a day and half now and

  • 0

I’ve been trying to tackle this problem for a day and half now and I can’t seem to figure out this strange behavior.

When I do that live.(‘click’ fn) it behaves like a double click. Well no that’s not the true, what happens is that if I click on it once it performs on action, then when I click on it again it files off the second action. Shouldn’t a single click fire all the actions within the click function? And also tried the simple $.click(fn) but that didn’t even work at all for a single click.

here is my code in quetion:

$('#details #map-home').live('click', function(){
    var name  = $('#dFname').text();
    ///////////////////////////////////////////////////////////////////
    ////////// Google Maps API Functions //////////////////////////////
    $(this).bind('cbox_complete', function(){
        var geocoder;
        var map;
        var a = $("span#address").text() + $("span#city").text() + $("span#state").text() + $("span#zip").text();
        //var image = 'http://code.google.com/apis/maps/documentation/javascript/examples/images/beachflag.png';
        var div = 
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(37.0625, -95.677068);
        var myOptions = {
            zoom: 19,
            center: latlng,
            disableDefaultUI: true,
            mapTypeId: google.maps.MapTypeId.HYBRID
        }
        map = new google.maps.Map(document.getElementById("map"), myOptions);

        geocoder.geocode( { 'address': a}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                map.setCenter(results[0].geometry.location);
                var infowindow = new google.maps.InfoWindow({
                    content: a
                });
                var marker = new google.maps.Marker({
                    map: map,
                    //draggable: true,
                    //icon: image,
                    position: results[0].geometry.location
                });
                google.maps.event.addListener(marker, 'click', function() {
                    infowindow.open(map, this);
                });
                infowindow.open(map, marker);
            } else {
                console.log("Geocode was not successful for the following reason: " + status);
            }
        });
    });
    ///////////////////////////////////////////////////////////////////
    $(this).colorbox({
        width:"650",
        inline: true,
        href:"#map",
        overlayClose: false
    });
    //$('#colorbox').draggable();
    return false
});

any ideas?

  • 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-17T19:17:34+00:00Added an answer on May 17, 2026 at 7:17 pm

    I don’t think using live here makes sense as you are dealing with a unique element with an id so
    I changed it to click instead. Also moved the bind to cbox_complete out of your click function as
    this is probably in line with expected behaviour. Also removed some strange code. Try the below.

    $("#map-home").bind('cbox_complete', function(){
        var geocoder;
        var map;
        var a = $("span#address").text() + $("span#city").text() + $("span#state").text() + $("span#zip").text();
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(37.0625, -95.677068);
        var myOptions = {
            zoom: 19,
            center: latlng,
            disableDefaultUI: true,
            mapTypeId: google.maps.MapTypeId.HYBRID
        }
        map = new google.maps.Map(document.getElementById("map"), myOptions);
        geocoder.geocode( { 'address': a}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                map.setCenter(results[0].geometry.location);
                var infowindow = new google.maps.InfoWindow({
                    content: a
                });
                var marker = new google.maps.Marker({
                    map: map,
                    position: results[0].geometry.location
                });
                google.maps.event.addListener(marker, 'click', function() {
                    infowindow.open(map, this);
                });
                infowindow.open(map, marker);
            } else {
               console.log("Geocode was not successful for the following reason: " + status);
            }
        });
    });
    $("#map-home").click(function(){
        $(this).colorbox({
            width:"650",
            inline: true,
            href:"#map",
            overlayClose: false
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.