FAQ | Points | Add... | Recent posts | Search | Register | Log in


[JS][HTML] Dynamiczne zmienianie koloru czcionki.


Post new topic  This topic is locked      Main Page -> Forum Index -> Programming Generally -> [JS][HTML] Dynamiczne zmienianie koloru czcionki.
Author
Message
Ksysiek
Poziom 14
Poziom 14


Joined: 12 Nov 2010
Posts: 179

Post#1 Post from the author of the topic 09 Jan 2011 15:50   

[JS][HTML] Dynamiczne zmienianie koloru czcionki.


Witam.

Na swojej stronie chciałbym umieścić napisy, które po najechaniu zmieniałyby kolor, a po zjechaniu kursorem przybierały by dawną postać.
Zarys kodu :
Code HTML - [expand]
<html>
<head>
</head>
<body>
<a onMouseOver="'" onmouseout=""> <u> Dom </u> </a>
<a onMouseOver="'" onmouseout="'"> <u> Londyn </u> </a>
</body>
</html>
 

Nie wiem niestety co wstawić po onMouseOver i po onmouseout.
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 09 Jan 2011 15:50   





Back to top
   
Dżyszla
Poziom 24
Poziom 24


Joined: 15 May 2005
Posts: 4736
Location: Żory (kiedyś Opole)

Post#2 09 Jan 2011 16:41helpful post - solution   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


nadać identyfikator obiektom, następnie odwołać się do tego obiektu poprzez identyfikator (getElementById) i ustawić własność style.color.
Jeden temat niżej: http://www.elektroda.pl/rtvforum/topic1874298.html
Na identycznej zasadzie opiera się zmiana wszystkich innych atrybutów.
Back to top
   
Manfred48
Poziom 15
Poziom 15


Joined: 04 Jun 2009
Posts: 241
Location: Gdansk

Post#3 09 Jan 2011 18:42helpful post - solution   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


Można to zrobić zwykłym CSS'em:

Code CSS - [expand]
a {
text-decoration :none;
font-weight: bold;
font-size: 10pt;
color: #fff;
}
 
a:hover {
font-weight: bold;
font-family: Times New Roman;
color: #ffbb00
}

Back to top
   
Google

Google Adsense


Post# 09 Jan 2011 18:42helpful post - solution   





Back to top
   
Ksysiek
Poziom 14
Poziom 14


Joined: 12 Nov 2010
Posts: 179

Post#4 Post from the author of the topic 09 Jan 2011 20:45   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


Dżyszla - działa. Dzięki. ;)
Manferd48 - Nie dokońca rozumiem całość kodu, ale problem rozwiązany.
Back to top
   
Dżyszla
Poziom 24
Poziom 24


Joined: 15 May 2005
Posts: 4736
Location: Żory (kiedyś Opole)

Post#5 09 Jan 2011 20:59   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


Kolega podał Ci również poprawne rozwiązanie, jeśli faktycznie ograniczysz się tylko do zmiany stylu. Poczytaj o CSS.
Back to top
   
Google

Google Adsense


Post# 09 Jan 2011 20:59   





Back to top
   
Ksysiek
Poziom 14
Poziom 14


Joined: 12 Nov 2010
Posts: 179

Post#6 Post from the author of the topic 10 Jan 2011 15:36   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


css rozumiem mniej więcej ale tego kodu nie ogarniam ;)
Back to top
   
Dżyszla
Poziom 24
Poziom 24


Joined: 15 May 2005
Posts: 4736
Location: Żory (kiedyś Opole)

Post#7 10 Jan 2011 18:42   

Re: [JS][HTML] Dynamiczne zmienianie koloru czcionki.


Ksysiek wrote:
css rozumiem mniej więcej ale tego kodu nie ogarniam ;)

Wybacz, ale to zdanie przeczy samo sobie.
Back to top
   
Post new topic  This topic is locked      Main Page -> Forum Index -> Programming Generally -> [JS][HTML] Dynamiczne zmienianie koloru czcionki.
Page 1 of 1
Similar topics
[HTML lub CSS] Symulacja Menu Start w HTML-u (23)
[HTML lub CSS] Przejście koloru jednego w drugi jako tło (3)
[HTML] - zmiana koloru tekstu w komorce po najechaniu myszka (3)
[HTML/CSS] active nie zmienia koloru (8)
Fonty w stronie html. Czcionki w formacie .ttf. Jak je wstawić? (5)
[PHP] Dynamiczne Tabele w HTML (11)
HTML->Dopasowanie koloru czcionki do tła (2)
[html, php, mysql] Jak zabronić zaczników html? (2)
[HTML] Automatyczny restart kamer z poziomu html (3)
Program w Bascomie, zmienianie zapamiętanych parametrów. (2)

Page generation time: 0.131 seconds


FAQ || Administrator || Moderators || Widgets and banners || Contact
elektroda.pl topic RSS feed