• Hi,

    Many thanks for this plugin.

    I’m trying to use clicks on countries to hide and show div containers relating to each country.

    On the maps, each country imapsContainer-group seems to have an id. For the UK it is ‘id-421’

    I’m using a simple jQuery script along the lines of:

    $(“#id-421”).on(‘click’, function (e) {
    $(‘.country-container#mygivenUKid’).fadeIn();
    });

    (My page content containers have the class ‘country-container’ and I’m giving each container a specific ID such as ‘mygivenUKid’.)

    This works fine with a general selector like .imapsContainer-group :

    $(“.imapsContainer-group”).on(‘click’, function (e) {
    $(‘.country-container#mygivenUKid’).fadeIn();
    });

    but does not work with the specific id : “id-421”

    It may be that the id does not exist in the DOM until it is clicked or it may be something to do with the hyphen or the string ‘id’

    Could you give me any idea why this isn’t working?

    Thanks again,

    Phil Nicholl

Viewing 1 replies (of 1 total)
  • Plugin Contributor Carlos Moreira

    (@carlosmoreirapt)

    Hi Phil. Those ids are not reliable to attach events to. This is better handled in the Pro version.
    Since you’re now using the Pro version, we can follow up in the ticket you opened recently. I’ll close this one.
    Greetings, Carlos

Viewing 1 replies (of 1 total)
  • The topic ‘Problem using ID for jQuery .on(‘click’) script’ is closed to new replies.