HighDots Forums  

Proprietà onmouseout da sistemare

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss Proprietà onmouseout da sistemare in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scream
 
Posts: n/a

Default Proprietà onmouseout da sistemare - 12-21-2007 , 05:29 AM






Ciao a tutti, ho un collegamento che allo stato onmouseover richiama
questo script:

function buttonClick() {
this.blur();
if (self.visible.length) {
self.hideAll();
} else {
var el = new Element(this.id);
if (el.hasChilds()) {
self.show(this.id);
}
}
}

Tutto ok, viene mostrato un <div> inferiore (per capirci è un menù a
tendina). Il problema è onmouseout. In pratica quando il mouse si sposta
al di fuori di questa tendina sopra altri collegamenti il <div> viene
nascosto, mentre se il mouse si sposta all'interno della pagina senza
aver cliccato su alcun link, rimane aperto il <div>.
Non c'è un modo per temporizzare la comparsa del div o nasconderlo?

Ecco il codice javascript richiamato dal div

/* event, item.onmouseover */
function itemOver() {
var el = new Element(this.id);
self.hideHigherOrEqualLevels(el.level);
if (el.hasChilds()) {
self.show(this.id);
}
}

/* event, item.onmouseout */
function itemOut() {
var el = new Element(this.id);
if (!el.hasChilds()) {
document.getElementById(this.id).className = "item";
}
}

/* event, item.onclick */
function itemClick() {
this.blur();
var el = new Element(this.id);
self.hideHigherOrEqualLevels(el.level);
if (el.hasChilds()) {
self.show(this.id);
}
}

Giusto per dovere di cronaca lo stesso <div> potrebbe a sua volta aprire
ulteriori sottomenù, ma non è importante in quanto gli stessi sottomenù
sono poi classificati come item

Grazie

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.