Created
January 23, 2013 03:33
-
-
Save yhahn/4601671 to your computer and use it in GitHub Desktop.
Mousewheel offset + fixed position
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src='https://raw.github.com/modestmaps/modestmaps-js/master/modestmaps.min.js'></script> | |
<style> | |
body { margin:0; padding:0; height:2000px; } | |
#map { position:fixed !important; top:0; width:500px; height:300px; } | |
</style> | |
</head> | |
<body> | |
<div id='map'></div> | |
<script> | |
var template = 'http://c.tiles.mapbox.com/v3/examples.map-szwdot65/{Z}/{X}/{Y}.png'; | |
var provider = new MM.TemplatedLayer(template); | |
var map = new MM.Map('map', provider); | |
map.setCenterZoom({ lat: 51.55, lon: 0.1 }, 5); | |
window.onload = function() { window.scrollTo(0,1000); }; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment