Hey guys, I've currently got a project going on where I'm using the JQuery Map Highlight Plugin ( by David Lynch:http://davidlynch.org/blog/2013/01/maphilight-for-jquery-1_9_0/ ) to create an outline effect on all counties in North Carolina when they are hovered. I've got two fairly big next steps that I'm not completely sure how to accomplish. I want to make it where if a user click on a county, a box appears below the map containing election results. Would I use the javascript toggle function here maybe? I have no idea. That box that's popping up under the map will be holding information from a custom post type through the backend of wordpress. What's the best way of targeting each county with in this box? Thanks guys!
Yes, you can use JavaScript to show the hidden content or use AJAX to load content when clicked. See like JS used for the interactive map of the U.S. http://www.fla-shop.com/products/html5/united-states/us/samples/ Try clicking on the green states. It uses code like the following javascript:set_text('div1'); Code (markup): and <SCRIPT> function set_text(div_name) { document.getElementById('main_text').innerHTML=document.getElementById(div_name).innerHTML } </SCRIPT> Code (markup):
Thanks Dmitrys, Where you are placing a div name inside the function - is that for the class name of the maps county, or the class name of the text layer that is initially hidden until selected?