-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8391b7a
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(function ($) { | ||
var onMapMouseleaveHandler = function () { | ||
var that = $(this); | ||
|
||
that.on('click', onMapClickHandler); | ||
that.off('mouseleave', onMapMouseleaveHandler); | ||
that.find('iframe').css("pointer-events", "none"); | ||
} | ||
|
||
var onMapClickHandler = function () { | ||
var that = $(this); | ||
|
||
// Disable the click handler until the user leaves the map area | ||
that.off('click', onMapClickHandler); | ||
|
||
// Enable scrolling zoom | ||
that.find('iframe').css("pointer-events", "auto"); | ||
|
||
// Handle the mouse leave event | ||
that.on('mouseleave', onMapMouseleaveHandler); | ||
} | ||
|
||
// Enable map zooming with mouse scroll when the user clicks the map | ||
$('.yourClass').on('click', onMapClickHandler); | ||
|
||
}(jQuery)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
|
||
<div class="yourClass"> | ||
<iframe style="pointer-events: none;"></iframe> | ||
</div> | ||
|
||
</body> | ||
</html> |