Answer the question
In order to leave comments, you need to log in
How to scroll on the map?
Hello, dear Toaster users! There is a site www.silkwaylog.com , at the bottom is a Yandex map.
You need to make it so that you can scroll it, not the site. How to implement it? Google or Yandex Maps - it doesn't matter.
And the second way. In order to scroll the site, you can click on the map and so that it starts scrolling, again clicking on another place, the site will scroll again.
I'm a noob in these matters, so please explain more clearly.
Answer the question
In order to leave comments, you need to log in
We do this during initialization:
var myMap = new ymaps.Map("map", {
center: [59.93, 30.31],
zoom: 10,
behaviors: ["scrollZoom"]
}
);
myMap.behaviors.disable("scrollZoom");
jQuery
$('#map_canvas').addClass('scrolloff');
$('#canvas').on('click', function () {
$('#map_canvas').removeClass('scrolloff');
});
$("#map_canvas").mouseleave(function () {
$('#map_canvas').addClass('scrolloff');
});
.scrolloff{
pointer-events: none;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question