Inko7 20:50 12-11-2009
Цитата:
[more=Подробнее]
Код: var nt = document.getElementById("nav-bar");
var pt = document.getElementById("PersonalToolbar");
var TimeOu = null;
function col(ct) {
pt.collapsed = ct;
}
function mouseover() {
if (TimeOu) window.clearTimeout(TimeOu);
TimeOu = window.setTimeout(col, 1000, false);
}
function mouseout() {
window.clearTimeout(TimeOu);
if (pt.collapsed == false) {
col(false);
}
}
function mouseoutp(event) {
if (event.originalTarget.className == "bookmark-item") {
var mu = event.relatedTarget;
if (mu.type == "menu") {
mu.firstChild.addEventListener("popuphidden", popuphidden, false);
}
}
if (event.ctrlKey || event.explicitOriginalTarget.parentNode.id == "") return;
if (event.relatedTarget.parentNode.id == "nav-bar" || event.relatedTarget.parentNode.id == "") {
col(true);
}
}
function popuphidden(event) {
if (event.explicitOriginalTarget.className == "menuitem-iconic bookmark-item") {
col(true);
}
}
nt.addEventListener("mouseout", mouseout, false);
nt.addEventListener("mouseover", mouseover, false);
pt.addEventListener("mouseout", mouseoutp, false);
Цитата:
но вместе с этим еще нужна доделка
[more=Подробнее]
Код: var nt = document.getElementById("nav-bar");
var pt = document.getElementById("PersonalToolbar");
var TimeOu = null;
function col(ct) {
pt.collapsed = ct;
}
function mouseover() {
if (TimeOu) window.clearTimeout(TimeOu);
TimeOu = window.setTimeout(col, 1000, false);
}
function mouseout() {
window.clearTimeout(TimeOu);
if (pt.collapsed == false) {
col(false);
}
}
function mouseoutp(event) {
if (event.originalTarget.className == "bookmark-item") {
var mu = event.relatedTarget;
if (mu.type == "menu") {
mu.firstChild.addEventListener("popuphidden", popuphidden, false);
}
}
if (event.ctrlKey || event.explicitOriginalTarget.parentNode.id == "") return;
if (event.relatedTarget.parentNode.id == "nav-bar" || event.relatedTarget.parentNode.id == "") {
col(true);
}
}
function popuphidden(event) {
if (event.explicitOriginalTarget.className == "menuitem-iconic bookmark-item") {
col(true);
}
}
nt.addEventListener("mouseout", mouseout, false);
nt.addEventListener("mouseover", mouseover, false);
pt.addEventListener("mouseout", mouseoutp, false);