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:
@@ -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"]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user