Popup menus improved

main
Inga 🏳‍🌈 14 years ago
parent 997740ae53
commit 595c903ff9
  1. 4
      static/js/machichara/simple.js
  2. 18
      static/js/modern.js

@ -7,8 +7,8 @@ function simpleMachicharaUpdater(element) {
function simpleMachicharaUpdate(element) {
clearTimeout(element.interval);
element.style.top = Math.floor(Math.random()*90) + "%";
element.style.left = Math.floor(Math.random()*90) + "%";
element.style.top = 5 + Math.floor(Math.random()*80) + "%";
element.style.left = 5 + Math.floor(Math.random()*80) + "%";
element.interval = window.setTimeout(simpleMachicharaUpdater(element), 5000+Math.floor(Math.random()*25000));
}

@ -1,15 +1,29 @@
function showChildren(elem) {
function getChildrenShower(elem) {
return function() {
for(var i=0; i<elem.childNodes.length; i++) {
if(elem.childNodes[i].nodeName == "DIV") {
elem.childNodes[i].style.display="block";
}
}
}
}
function hideChildren(elem) {
function showChildren(elem) {
clearTimeout(elem.interval);
elem.interval = setTimeout(getChildrenShower(elem), 200);
}
function getChildrenHider(elem) {
return function() {
for(var i=0; i<elem.childNodes.length; i++) {
if(elem.childNodes[i].nodeName == "DIV" && elem.childNodes[i].getAttribute("default") != "default") {
elem.childNodes[i].style.display="none";
}
}
}
}
function hideChildren(elem) {
clearTimeout(elem.interval);
elem.interval = setTimeout(getChildrenHider(elem), 200);
}
Loading…
Cancel
Save