Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlos Moreira carmoreira

View GitHub Profile
@carmoreira
carmoreira / script.js
Created February 27, 2023 23:12
Make overlay entries list interact with base map - Interactive Geo Maps
View script.js
document.querySelectorAll('.igm_entries_list')
.forEach(function(list) {
list.setAttribute('data-map-id','3492969'); // change to your base map ID
var clone = list.cloneNode(true);
iMapsActions.buildLists(clone);
list.replaceWith(clone);
});
@carmoreira
carmoreira / style.css
Created January 26, 2023 15:38
Hide zoom controls on desktop - interactive geo maps
View style.css
@media only screen and (min-width:780px) {
.imapsZoomControl-group { display:none; }
}
@carmoreira
carmoreira / style.css
Created January 20, 2023 22:59
Fix lightbox causing page to jump to top - Interactive Geo Maps
View style.css
html, body {
height: initial !important;
}
/* to override height:100% which caused the issue */
@carmoreira
carmoreira / filter.js
Created January 19, 2023 23:39
Testomonials Showcsase hashtag filter select
View filter.js
jQuery(document).ready(function(){
var thishash = window.location.href.slice(window.location.href.indexOf('#') + 1);
var menuitem = 'ul#tts-filter-nav li:contains("'+thishash+'")';
if(thishash.length && menuitem.length){
jQuery(menuitem).click();
}
});
@carmoreira
carmoreira / style.css
Created January 4, 2023 11:21
Advisor quiz - answer commentary with color code for correct or incorrect answers
View style.css
/* Incorrect */
.advq_question_container:has(li.quiz_incorrect_answer) .advq_answer_commentary { background:red !important; color:#fff !important; }
/* Correct */
.advq_question_container:has(li.quiz_correct_answer) .advq_answer_commentary { background:green !important; color:#fff !important; }
@carmoreira
carmoreira / styles.css
Last active March 24, 2023 13:12
pulsating markers effect with css - interactive geo maps
View styles.css
.imapsCircle {
paint-order: stroke;
stroke-opacity:1;
stroke: #dd9933; /* change with the stroke color you want */
animation: pulse-me 1s linear infinite;
}
/* or target by colour */
.imapsCircle-group[fill="#1e73be"] .imapsCircle {
@carmoreira
carmoreira / front.php
Created July 18, 2022 10:04
Add more share button to Advisor Quiz WordPress plugin
View front.php
// Replace this function in your front.php to give customers more share buttons.
function advq_get_after_results_content($id,$data,$options) {
$html = '';
if(isset($data['code_after_results']) && $data['code_after_results'] != ''){
$html .= '<div class="advq_integration_after_results">';
if( $options['render_shortcodes_integration'] ){
@carmoreira
carmoreira / pan.js
Last active June 22, 2022 09:01
Interactive Geo Maps - Remove Pan out limit - allow map to be dragged beyond the limits
View pan.js
// replace with your map ID.
let mapID = 877;
let mapContainer = document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready',function(ev){
iMaps.maps[mapID].map.maxPanOut = 10;
});
@carmoreira
carmoreira / reset.js
Created June 17, 2022 09:09
Interactive Geo Maps - Reset actions after menu filter dropdown changes
View reset.js
// replace 55677 with your map ID
document.addEventListener('input', function (event) {
if (event.target.id !== 'igm-live-filter-55677') return;
iMapsActions.resetActions(55677);
});
@carmoreira
carmoreira / igm-custom-solution.php
Created June 16, 2022 16:03
Interactive Geo Maps - Custom Solution to read from custom meta fields
View igm-custom-solution.php
<?php
/**
* Interactive Geo Maps Custom Solution
*
* @wordpress-plugin
* Plugin Name: Interactive Geo Maps Custom Solution
* Plugin URI: https://interactivegeomaps.com
* Description: Reads from custom meta fields
* Version: 1.0.0
* Author: Carlos Moreira