I am having problems with the mouse being connected to the Openlayers map when the map is placed inside a fixed position DIV. The map works great when you are at the top of the browser window, but when you scroll the page, you can see that the zoom / click effects are shifted. Here you can check http://41.32.148.178:82/#!search=KFC%2F0%2F0%2F0%2F%2F to see what I mean.
It seems to the guys that he was facing the same problem, but did not receive any answers http://lists.osgeo.org/pipermail/openlayers-users/2010-July/018769.html
This was a bug in the version of OpenLayers that I used (2.1), I upgraded to the latest version (2.11), and now everything works fine, thanks.
I think you need to adjust the position of the map based on the vertical and horizontal scollbar values.
For firefox, chrome, safari, opera use this code to get scroll values
window.pageXOffset window.pageYOffset
whereas for this use
document.body.scrollLeft document.body.scrollTop
see examples here
http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
http://www.w3schools.com/jsref/prop_win_pagexoffset.asp
Source: https://habr.com/ru/post/1398987/More articles:twitter-bootstrap row-fluid does not adjust the height depending on this child size - htmlOracle.jdbc.driver.OracleDriver () no error exists - javaSed script to delete the first two lines of a file if they are empty - pattern-matchingOpenLayers click event on iPhone using PhoneGap - javascriptSimple HTML DOM Parser - send variable messages - phpddply lag with multiple subsets - rSophisticated sql date logic: how can I plan my reports? - sqlJava jitter buffer implementation - javaI want to lower the frame rate of video capture in AVCapture - iosHow many requests can a port handle in "time" - javaAll Articles