Skip to content

Instantly share code, notes, and snippets.

View DylanCodeCabin's full-sized avatar

Dylan Auty DylanCodeCabin

View GitHub Profile
@DylanCodeCabin
DylanCodeCabin / custom.css
Created September 27, 2019 07:13
Patrick Henry Custom listing
.wpgmza_special_listing {
text-align: center;
width: 60%;
margin-left: auto;
margin-right: auto;
}
.wpgmza_special_listing .wpgmza_special_col{
width: 50%;
@DylanCodeCabin
DylanCodeCabin / custom.css
Created September 16, 2019 08:42
Highlight Table Row and Info-Window based on Category
.wpgmza_map img {
max-width:none;
}
.wpgmza_widget {
overflow: auto;
}
.highlightrow {
background-color:yellow !important;
@DylanCodeCabin
DylanCodeCabin / customscript.js
Last active September 9, 2019 07:41
Scroll Marker Example
var last_opened_marker = false;
jQuery(document).ready(function () {
jQuery(window).scroll(function (event) {
var scrollTop = jQuery(window).scrollTop();
if((scrollTop > jQuery('.wpgmza_side_left').offset().top) && (scrollTop < (jQuery('.wpgmza_side_left').height() - 350 + jQuery('.wpgmza_side_left').offset().top)) ){
jQuery('.wpgmza_side_right .wpgmza_map').css('position', 'fixed');
jQuery('.wpgmza_side_right .wpgmza_map').css('width', jQuery('.wpgmza_side_right').width() + 'px');
jQuery('.wpgmza_side_right .wpgmza_map').css('top', '55px');
} else {
/** experimental */
function wpgmza_normalize_lat_lng_group(lat_lng_array){
var lat = 0;
var lng = 0;
var poly_bounds = new google.maps.LatLngBounds();
for(var in_idx in lat_lng_array){
if(lat_lng_array[in_idx][0] && lat_lng_array[in_idx][1]){
var c_lat = parseFloat(lat_lng_array[in_idx][0]);
jQuery(window).load(function(){
for(var poly_i in WPGM_Path_Polygon){
google.maps.event.addListener(WPGM_Path_Polygon[poly_i], 'mouseover', function(event){
google.maps.event.trigger(this, 'click', {latLng: event.latLng});
});
google.maps.event.addListener(WPGM_Path_Polygon[poly_i], 'mousemove', function(event){
for(var info_idx in infoWindow_poly){
if(typeof infoWindow_poly[info_idx].close !== 'undefined'){
#wp-live-chat-header.active:before{
display: none;
opacity: 0;
}
#wp-live-chat-header:before {
content: "Chat with a live rep now!";
width: 180px;
position: absolute;
display: inline-block;
#wp-live-chat-header {
-webkit-animation: wplc-pulse 1s infinite !important;
-moz-animation: wplc-pulse 1s infinite !important;
-o-animation: wplc-pulse 1s infinite !important;
animation: wplc-pulse 1s infinite !important;
animation-name: wplc-pulse !important;
animation-duration: 1s !important;
animation-timing-function: ease !important;
animation-delay: 0s !important;
animation-iteration-count: infinite !important;
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(value) {
if(typeof value !== 'undefined' && value !== null){
if(value.indexOf('wpgmza_datatables_sl') !== -1){
this.addEventListener("load", function(){
if(typeof this.responseText !== 'undefined'){
if(this.responseText == ""){
alert("No Results Found");
}
window.onload = function(e){
if(typeof MYMAP !== 'undefined'){
for (var map_i in MYMAP) {
var bounds = new google.maps.LatLngBounds();
for (var marker_i in marker_array[map_i]) {
bounds.extend( marker_array[map_i][marker_i].getPosition() );
}
MYMAP[map_i].map.googleMap.setOptions({maxZoom: 21, minZoom: 1});
/** Code will run through all markers, add them as waypoints and generate a route with directions
* Nice trick for tour companies who would like more accurate routes with an automation (no polylines)
*/
jQuery(function(){
jQuery(window).load(function(){
for(var i in wpgmaps_localize_marker_data){
var markers = wpgmaps_localize_marker_data[i];
var count = 0;