Use document.getElementById in examples.

Previously examples would either use the now deprecated `window.$` or the
non-API-method `OpenLayers.Util.getElement`. This was well caught by @probins
and @elemoine.
This commit is contained in:
Marc Jansen
2012-05-29 21:47:22 +02:00
parent 042ad8d711
commit acb9f950df
11 changed files with 51 additions and 69 deletions
+8 -9
View File
@@ -69,7 +69,6 @@
<script src="Jugl.js"></script>
<script src="animator.js"></script>
<script type="text/javascript">
var $ = OpenLayers.Util.getElement;
var map, template;
@@ -173,21 +172,21 @@
function display(event) {
// clear previous photo list and create new one
$("photos").innerHTML = "";
document.getElementById("photos").innerHTML = "";
var node = template.process({
context: {features: event.feature.cluster},
clone: true,
parent: $("photos")
parent: document.getElementById("photos")
});
// set up forward/rewind
var forward = Animator.apply($("list"), ["start", "end"], {duration: 1500});
$("scroll-end").onmouseover = function() {forward.seekTo(1)};
$("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
$("scroll-start").onmouseover = function() {forward.seekTo(0)};
$("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
var forward = Animator.apply(document.getElementById("list"), ["start", "end"], {duration: 1500});
document.getElementById("scroll-end").onmouseover = function() {forward.seekTo(1)};
document.getElementById("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
document.getElementById("scroll-start").onmouseover = function() {forward.seekTo(0)};
document.getElementById("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
// set up photo zoom
for(var i=0; i<event.feature.cluster.length; ++i) {
listen($("link-" + i), Animator.apply($("photo-" + i), ["thumb", "big"]));
listen(document.getElementById("link-" + i), Animator.apply(document.getElementById("photo-" + i), ["thumb", "big"]));
}
}