<?php get_template_part('parts/community-map-svg'); ?>
</div>
<div id="mapRegionData">
- <?php $community_page_object = get_page( 155); ?>
- <?php $community_page_image = wp_get_attachment_url( get_post_thumbnail_id(155)); ?>
+ <?php $community_page_object = get_page( 155 ); ?>
+ <?php $community_page_image = wp_get_attachment_url( get_post_thumbnail_id( 155 )); ?>
<?php $community_page_content = json_encode(substr(strip_tags($community_page_object->post_content),0, 300)); ?>
<div class="map-image-container">
</div>
var community_link = $("#interactive-map");
var default_content = <?php echo $community_page_content ?>;
- $(community_link).find(".dropdown").mouseleave( function () {
+ // set the default data next to the dropdown community map
+ function set_default_data(){
regionData.find(".map-page-title").html('<?php echo $community_page_object->post_title; ?>');
regionData.find(".map-image-container").css("height","200px").css("width", "250px").css("background", "url(' <?php echo $community_page_image; ?> ')no-repeat center center").css("background-position", "cover");
regionData.find(".map-page-content").html(default_content);
-
+ }
+
+ $(community_link).find("li").mouseenter( function () {
+ set_default_data();
+ });
+ $(community_link).find(".dropdown").mouseleave( function () {
+ set_default_data();
});
// hover effects and data collection