Вам необходимо выполнить showHide ('hideUI', 'showUI'); при загрузке страницы. Следующий Javascript должен работать:
function showHide(thingToHide, thingToShow) {
document.getElementById("status").innerHTML = "Shown";
if (thingToHide == "showUI") {
document.getElementById("status").innerHTML = "Hidden";
}
document.getElementById(thingToHide).style.visibility = "hidden";
document.getElementById(thingToShow).style.visibility = "visible";
}
showHide('hideUI', 'showUI');
Это - хитрое. Определенное лужение привело к этому:
function setupmousemovement() {
var map1 = document.getElementById('Map_Panel');
map1.onmousemove = (function() {
var timer,
timer250,
onmousestop = function() {
// code to do on stop
clearTimeout( timer250 ); // I'm assuming we don't want this to happen if mouse stopped
timer = null; // this needs to be falsy next mousemove start
};
return function() {
if (!timer) {
// code to do on start
timer250 = setTimeout(function () { // you can replace this with whatever
// code to do when 250 millis have passed
}, 250 );
}
// we are still moving, or this is our first time here...
clearTimeout( timer ); // remove active end timer
timer = setTimeout( onmousestop, 25 ); // delay the stopping action another 25 millis
};
})();
};
Причина Ваш код не работает, состоит в том, что mousemove стреляет неоднократно, в то время как мышь перемещается, и Вы запускаете новые тайм-ауты каждый раз.