Disables scrolling with the mouse wheel on Google map

Original article

Solved this putting a div with an .overlay exactly before each Google map iframe insertion. The div will cover the map, preventing pointer events from getting to it. But if you click on the div, it becomes transparent to pointer events, activating the map again!

The markup

  <div class="overlay" onClick="style.pointerEvents='none'"></div>
  <iframe src="" width="640" height="480"></iframe>


.overlay {
   height:480px; /* your iframe height */
   top:480px;  /* your iframe height */
   margin-top:-480px;  /* your iframe height */

There is a jQuery solution for this if you do not embed the map via iFrame.

$(function() {
    $('#map').click(function(e) {
        $(this).find('.gm-style').css('pointer-events', 'all');
    }).mouseleave(function(e) {
        $(this).find('.gm-style').css('pointer-events', 'none');

And a little bit of CSS

.gm-style {
	pointer-events: none;

Execute function on defined vertical scroll position

$(window).scroll(function() {
    var y_scroll_pos = window.pageYOffset;
    var scroll_pos_test = 150;             
	// set to whatever you want it to be

    if(y_scroll_pos > scroll_pos_test) {

Expand and collapse widget

The jQuery

$(document).ready(function() {
  //Initially hide all the expandable content with class name "content" 
  //Toggle the component when parent class "heading" is clicked on 
  $(".heading").click(function() {
    var header = $(this);
    //Toggle the arrow image based on whether the content <p> is expanded or not
    header.children('#arrow').toggleClass('plus_sign minus_sign');
    //Expand or collapse the content <p> with slide mode animation".content").slideToggle(500);


* {
	margin: 0;
	padding: 0;
	background: transparent;

.layer {
	width: 460px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.95em;
	background-color: #fafafa;

.heading {
	margin-top: 2px;
	color: #fff;
	padding: 5px 10px;
	background: #B72A31;

.content {
	padding: 10px;

h1 { 
	padding: 0 5px;
	display: inline-block;
	vertical-align: middle;
	font-size: 1.2em;

.arrow {
	width: 26px;
	height: 26px;
	display: inline-block;
	vertical-align: middle;

.plus_sign {
	background-image: url('images/plus_icon.png');

	background-image: url('images/minus_icon.png');

The markup

<div class="heading">
	<div id="arrow" class="arrow plus_sign"></div>
	<h1>A Statement</h1>
<p class="content">The result of this aesthetic way of working is the original Artisan: Primarius'city bike. This bike combines classic shapes with modern design: A visual masterpiece con-taining DNA of authenticity, agility, finesse and crafts-manship. Primarius' Artisan proves that along with the perfection of the industrial revolution, we have also lost something substantial: authenticity.