Radi se o dinamickom skriptu | navigacije baziranog na javascriptu !
Code:
<STYLE type='text/css'>
li.oItem { color: #FF0000; cursor: text; } ;
li.oParent { color: #008000; cursor: hand; } ;
ul ul { display: none; } ;
</STYLE>
<SCRIPT LANGUAGE='Javascript'>function checkParent( src, tagName ) {
while ( src != null ) {
if (src.tagName == tagName)
return src;
src = src.parentElement;
}
return null;
}
function checkContent( src, tagName ) {
var pos = src.sourceIndex ;
while ( src.contains( document.all[++pos] ) )
if ( document.all[pos].tagName == tagName )
return document.all[pos] ;
return null ;
}
function outlineAction() {
var src = event.srcElement ;
var item = checkParent( src, "LI" ) ;
if ( parent != null ) {
var content = checkContent( item, "UL" ) ;
if ( content != null )
if ( content.style.display == "" )
content.style.display = "block" ;
else
content.style.display = "" ;
}
event.cancelBubble = true;
}
</SCRIPT>
<DIV onClick="JavaScript: outlineAction();">
<UL>
<LI class='oParent'>Test1
<UL>
<LI class='oParent'>Test11
<UL>
<LI class='oItem'>Test111</LI>
<LI class='oItem'>Test112</LI>
</UL></LI>
</UL></LI>
<LI class='oParent'>Test2
<UL>
<LI class='oParent'>Test21
<UL>
<LI class='oParent'>Test211
<UL>
<LI class='oItem'>Test2111</LI>
</UL></LI>
</UL></LI>
<LI class='oItem'></LI>
</UL></LI>
</UL>
</DIV>
<STYLE type='text/css'>
li.oItem { color: #FF0000; cursor: text; } ;
li.oParent { color: #008000; cursor: hand; } ;
ul ul { display: none; } ;
</STYLE>
<SCRIPT LANGUAGE='Javascript'>function checkParent( src, tagName ) {
while ( src != null ) {
if (src.tagName == tagName)
return src;
src = src.parentElement;
}
return null;
}
function checkContent( src, tagName ) {
var pos = src.sourceIndex ;
while ( src.contains( document.all[++pos] ) )
if ( document.all[pos].tagName == tagName )
return document.all[pos] ;
return null ;
}
function outlineAction() {
var src = event.srcElement ;
var item = checkParent( src, "LI" ) ;
if ( parent != null ) {
var content = checkContent( item, "UL" ) ;
if ( content != null )
if ( content.style.display == "" )
content.style.display = "block" ;
else
content.style.display = "" ;
}
event.cancelBubble = true;
}
</SCRIPT>
<DIV onClick="JavaScript: outlineAction();">
<UL>
<LI class='oParent'>Test1
<UL>
<LI class='oParent'>Test11
<UL>
<LI class='oItem'>Test111</LI>
<LI class='oItem'>Test112</LI>
</UL></LI>
</UL></LI>
<LI class='oParent'>Test2
<UL>
<LI class='oParent'>Test21
<UL>
<LI class='oParent'>Test211
<UL>
<LI class='oItem'>Test2111</LI>
</UL></LI>
</UL></LI>
<LI class='oItem'></LI>
</UL></LI>
</UL>
</DIV>
Gdje i kako bi mogao da taj skript napravim i za NS ?
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."