Popup menus improved

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

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

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