-
-
Save paulbounce/09afd1bb2d66b350578a13f3f5f4f220 to your computer and use it in GitHub Desktop.
100% Width Google Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.maps iframe{ | |
pointer-events: none; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
/* | |
Imports Jquery 1.4.2 | |
*/ | |
<script type="text/javascript"> | |
/* | |
Incorporates code snippets from community.unbounce.com and Stack Overflow. | |
*/ | |
/** | |
* Do not remove this section; it allows our team to troubleshoot and track feature adoption. | |
* TS:0002-17-079 | |
*/ | |
// Replace URL with your embed map URL | |
var mapUrl = "URL" | |
/* | |
Appends the map into the page section. | |
Replace #lp-pom-block-8 with the ID of the page section where you want a map | |
Modify 'height' to match the height of your page section in pixels | |
*/ | |
$( "#lp-pom-block-8 .lp-pom-block-content" ).css('width','100%').append('<div class="embed-container maps"><iframe src="' + mapUrl + '" width="100%" height="400px" frameborder="0" style="border:0"></iframe></div>'); | |
// disables scroll wheel unless the map is clicked. No need to modify. | |
$(document).ready(function() { | |
$('.maps').click(function () { | |
$('.maps iframe').css("pointer-events", "auto"); | |
}); | |
$( ".maps" ).mouseleave(function() { | |
$('.maps iframe').css("pointer-events", "none"); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment