Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 1 odgovor
  • 2.655 pregleda

Najnovija ↓

Pomoch oko navigacije 05.02.2004. u 09:45 · pre 276 meseci #1
Treba mi jedan dobar skript poput ovog za navigaciju, a fora je jer ovaj radi samo na IE4+ na NS ne radi.
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>


Gdje i kako bi mogao da taj skript napravim i za NS ?
Potpis
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."
Re: Pomoch oko navigacije 05.02.2004. u 10:24 · pre 276 meseci #2
Koliko ja vidim ovo je obicno DHTML stablo. Jedna od najpoznatijih
takvih stvari ti se nalazi ovde: http://www.mmartins.com/ft/ . Tu je
download, tu je sve - i radi u maltene svim popularnim browserima.
Potpis
Dejan Lekic
software engineer, MySQL/PgSQL DBA, sysadmin
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme