Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Posts
    590
    Thanks
    66
    Thanked 2 Times in 2 Posts

    Question JVectorMap onclick events, JVectorMap & Tab Switch won't work at the same time

    Hello,

    Okay, so I have found that implementing the following should return something;
    Code:
    	$('#map-events').vectorMap({
    		onRegionClick: function(event, code){},
    	});

    ...And I have this very simple JQuery Tab Switch, which you can see on JSFiddle

    Although both the map and tab switch use the same JQuery files, I cannot get them both to work at the same time and have now made a live version: https://tornhq.com/AroundTheWorld/Maps/tests/index.html

    Also, I need to know how to make a click of a map show a certain tab.

    Best Regards,
    Tim
    Last edited by MrTIMarshall; 03-22-2013 at 05:30 PM.

  2. #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,476
    Thanks
    57
    Thanked 633 Times in 628 Posts
    I'm guessing that the documentation is as good a place to start as any:

    onRegionClick
    Callback function which will be called when the user clicks the region path. Region code will be passed to the callback as argument.
    looks promising...

  3. Users who have thanked xelawho for this post:

    MrTIMarshall (03-22-2013)

  4. #3
    Regular Coder
    Join Date
    Nov 2010
    Posts
    590
    Thanks
    66
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by xelawho View Post
    I'm guessing that the documentation is as good a place to start as any:

    looks promising...
    Thank you. Now I just need to know how I can start making my own maps as I have been searching for hours upon hours how to make a map where I've not found any use for making shape files or whatnot, I am at a complete loss and really need this for my future website.

    I shall play around with this function in the morning, thank you for your input.

    Best Regards,
    Tim

  5. #4
    Regular Coder
    Join Date
    Nov 2010
    Posts
    590
    Thanks
    66
    Thanked 2 Times in 2 Posts
    Okay, so I have found that implementing the following should return something;
    Code:
    	$('#map-events').vectorMap({
    		onRegionClick: function(event, code){},
    	});

    ...And I have this very simple JQuery Tab Switch, which you can see on JSFiddle

    How can I merge them both together, so when you click on a country it shows a tab, and when you click o n the country, what is called, is it the code such as GB for Great Britain?

    Edit:
    Although both the map and tab switch use the same JQuery files, I cannot get them both to work at the same time and have now made a live version: https://tornhq.com/AroundTheWorld/Maps/tests/index.html
    Last edited by MrTIMarshall; 03-22-2013 at 05:06 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •