selfhtml.de - Alles für den Webmaster!

 

Anzeige: united-domains - Die ganze Welt der Domains

united domains - jetzt Wunsch-Domain sichern!

Einfache & schnelle Domain-Registrierung zu fairen Preisen ohne Einrichtungsgebühren. Mehr als 250 Domain-Endungen aus einer Hand inklusive E-Mail- & Web-Weiterleitung. Einzigartiges Domain-Portfolio zur bequemen & sicheren Verwaltung Ihrer Domain-Namen.

Jetzt Domain-Check bei united-domains!

Kann bei einem Objekt font nicht formatieren.

Autor: solirocks [Beiträge: 7]
Datum: 03.03.2010 14:16:26

Ich habe eine Navigation mit ein wenig JS, PHP und CSS programmiert. Funktioniert beinahe so, wie ich es möchte. Aber den Text des aktiven Links kann ich nicht formatieren. Jegliche Formatierung die den Text betrifft wird einfach nicht übernommen.

Liegt es vielleicht am Javascript?

Mein Code für die Nav:

-----------------------------------------------------------
<script type="text/javascript">
<!--
function mark(id)
{
for(i=0; i <
document.getElementById("mainnav").getElementsByTagName("li").length; i++)
{
document.getElementById("mainnav").getElementsByTagName("li")[i].className="";
}
id.className="over";
}

function toggleswitch(id)
{
var d = document.getElementById(id);
for (var i = 1; i<=7; i++) {
if (document.getElementById('sub'+i)) {document.getElementById('sub'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
//-->
</script>


<div class="logo">
<!--<img src="head.png">-->
</div>

<div class="navigation">

<div class="hlist">

<div id="mainnav">

<ul>

<li
<?php if ($thisPage=="page1") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub1')">
<a href="#">Page1</a>
</li>

<li
<?php if ($thisPage=="page2") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub2')">
<a href="#">Page2</a>
</li>

<li
<?php if ($thisPage=="page3") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub3')">
<a href="#">Page3</a>
</li>

<li
<?php if ($thisPage=="page4") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub4')">
<a href="#">Page4</a>
</li>

<li
<?php if ($thisPage=="page5") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub5')">
<a href="#">Page5</a>
</li>

<li
<?php if ($thisPage=="page6") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub6')">
<a href="#">Page6</a>
</li>

<li
<?php if ($thisPage=="page7") {echo " class="over"";} ?>
onmouseover="mark(this); toggleswitch('sub7')">
<a href="#">Page7</a>
</li>

</ul>

</div>

<div style="clear:left;"></div>



<div id="subnav">

<div id="sub1"
<?php if ($thisPage=="page1") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page1 Eintrag1</li>
<li>|</li>
<li>Page1 Eintrag2</li>
</ul>
</div>

<div id="sub2"
<?php if ($thisPage=="page2") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page2 Eintrag1</li>
<li>|</li>
<li>Page2 Eintrag2</li>
<li>|</li>
<li>Page2 Eintrag3</li>
</ul>
</div>

<div id="sub3"
<?php if ($thisPage=="page3") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page3 Eintrag1</li>
<li>|</li>
<li>Page3 Eintrag2</li>
<li>|</li>
<li>Page3 Eintrag3</li>
<li>|</li>
<li>Page3 Eintrag4</li>
</ul>
</div>

<div id="sub4"
<?php if ($thisPage=="page4") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page4 Eintrag1</li>
<li>|</li>
<li>Page4 Eintrag2</li>
</ul>
</div>

<div id="sub5"
<?php if ($thisPage=="page5") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page5 Eintrag1</li>
<li>|</li>
<li>Page5 Eintrag2</li>
<li>|</li>
<li>Page5 Eintrag3</li>
</ul>
</div>

<div id="sub6"
<?php if ($thisPage=="page6") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page6 Eintrag1</li>
<li>|</li>
<li>Page6 Eintrag2</li>
<li>|</li>
<li>Page6 Eintrag3</li>
<li>|</li>
<li>Page6 Eintrag4</li>
</ul>
</div>

<div id="sub7"
<?php if ($thisPage=="page7") {echo " style="display:block;"";}
else {echo " style="display:none;"";}?>>
<ul>
<li>Page7 Eintrag1</li>
<li>|</li>
<li>Page7 Eintrag2</li>
</ul>
</div>


  </div>
</div>
</div>

-----------------------------------------------------------


Und hier das dazugehörige CSS
-----------------------------------------------------------

/* Hier ist das style-template zur Navigation */

.navigation {
margin-left:-22px;
margin-top:-61px;
}

.over {
color:#104380;
background-color: #dad7d7;
}

#mainnav li{
font-size: 16px;
font-weight:bold;
padding-top:3px;
padding-left:8px;
padding-right:8px;
padding-bottom:5px;
}

#mainnav a:link, #mainnav  a:visited, #mainnav  a:focus, #mainnav  a:active {
color:white;
text-decoration:none;
}

#mainnav a:hover {
color:#104380;
text-decoration:none;
}

#subnav {
margin-top:-15px;
padding-bottom:1px;
}

#subnav li{
color: #104380;
font-size: 12px;
padding-left:3px;
padding-right:3px;
}

.hlist li {
float:left;
list-style:none;
display:inline;
}

/* Hier ist das style-template zur Navigation */


Beiträge

Antwort schreiben

Username: Usernamen registrieren
Passwort: Passwort vergessen?
Thema:
  Bitte benutze für deinen Beitrag die Groß-/Kleinschreibung!
Beitrag:
Link (URL):
Titel für Link:
Grafik (URL):
  Die Breite der Grafik darf 468 Pixel nicht überschreiten.
 
E-Mail-Benachrichtigung:



Zum Abschicken deines Beitrags bitte die Schaltfläche "Abschicken" nur einmal anklicken und warten. Der Server braucht manchmal einige Zeit, bis er den Beitrag in die Datenbank übernommen hat. Wenn du die Schaltfläche mehrmals drückst, erscheint dein Beitrag auch mehrmals im Forum.

Bewerten Sie Ihren Webhosting-Provider

Webhosting Provider bewerten und Apple iPad gewinnenWie zufrieden sind Sie mit Ihrem Webhosting-Provider? Gibt es Probleme beim Service, mit der Performance oder der Abrechnung?

Teilen Sie jetzt Ihre Erfahrungen mit anderen Webmastern und schreiben Sie eine Provider-Bewertung. Mit etwas Glück können Sie ein Apple iPad gewinnen!

Weitere Informationen und Teilnahme...