The problem happens in Firefox and IE, Chrome and Safari work great. I have a map with Leaflet in fixed position and when I double click to zoom on the map and I am scrolled up it zooms without problem. But, when I scroll down, the zoom goes to somewhere else (to the south) and it increments if I scroll down deeper.
I can fix the problem if I remove the DOCTYPE, but I do not want to do that.
To reproduce the problem, just execute the code in Firefox, scroll down and double click on the map to zoom.
NOTE: I passed the W3C validator, so the problem could be from leaflet.
Here is the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css">
<style type="text/css">
body {
height: 4000px;
}
#map {
position: fixed;
width: 500px;
height: 300px;
top: 50px;
left: 100px;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
// Initialize the map on the "map" div
map = L.map('map', {
maxZoom: 18,
minZoom: 12,
zoom: 14,
scrollWheelZoom: false
});
map.setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.cloudmade.com/12099dbdd2c7459d99b220fea3008f7d/997/256/{z}/{x}/{y}.png').addTo(map);
</script>
</body>
Also, here is the example in jsfiddle: http://jsfiddle.net/yGaQM/ (remember, in Chrome/Safari it works)
Any help would be really appreciated.