HighDots Forums  

cancellare appendchild (codice di ZERO)

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


Discuss cancellare appendchild (codice di ZERO) in the Javascript (Italian) forum.



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

Default cancellare appendchild (codice di ZERO) - 05-06-2008 , 12:25 PM






--da un precedente suggerimento di ZERO (ringrazio )
con codice sotto posso inserire sez1 e sez2 in un altro div;

devo evitare che ul inserito da TEST1 rimanga quando è attivato TEST2
e viceversa;

NB non posso usare evento onmouseout perchè id-div-destinazione deve
rimanere con i valori assegnati;



--inoltre:getElementsByTagName("UL") o ...("ul") ?



function movingUL( sender ){
var ul = sender.getElementsByTagName("UL")[0];

if ( ul )
document.getElementById("id-div-destinazione").appendChild(ul);

}





HTML:

<li class="level-1" onmouseover="movingUL(this)"><a href="" >TEST1</a>
<ul>
<li><a href="">sez1</a></li>
<li><a href="">sez2</a></li>
</ul>
</li>

<li class="level-1" onmouseover="movingUL(this)"><a href="" >TEST2</a>
<ul>
<li><a href="">sez3</a></li>
<li><a href="">sez4</a></li>
</ul>
</li>

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.