Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Cufon - hover
Mega_88
post 6.10.2011, 12:12:30
Post #1





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Hej ! Mam bardzo pilną rzecz do zrobienia, a już się pogubiłem. Nie wiem czy za to jest odpowiedzialny skrypt Cufon czy może czegos w CSS nie mam. Może ktoś rzucić na to okiem i mi pomóc ?

Chodzi o to, że sama funkcja hover działa, ale jeżeli wejdę w jakąś zakłądkę chce żeby kolor był zachowany z "hover". Czyli tak na szybko - Mam link "Start" , który jest biały po najechaniu kursorem robi się czarny, ale i po kliknieciu w "Start" również zostaje czarny. Może ktoś pomóc ? Poniżej linie kodu:

Kod strony
Cytat
<?php
if ($id==7 or $id==8 or $id==9) echo
'<div class="menu1">
<a href="start" style="margin-right:10px"><h3>Start</h3></a>
<a href="historia" style="margin-right:10px"><h3>Start</h3></a>
<a href="srebrna" style="margin-right:10px"><h3>Start</h3></a>
<a href="zlota" style="margin-right:10px"><h3>Start</h3></a>
<a href="brazowa" style="margin-right:10px"><h3>Start</h3></a>
<a href="kontakt" style="margin-right:0px"><h3>Start</h3></a>
</div>'
?>


JS do Cufon
Cytat
Cufon.replace("h3", { hover: {color: '#bb9e55'} });


CSS
Cytat
.menu1 { float:right; width:720px;height:10px;margin-top:100px;}
.menu1 a, .menu1 span { display:block;float:left;margin-left:5px }
.menu1 a { color:#ffffff;font-size:12px;}
.menu1 a:hover { color:#bb9e55;font-size:12px;padding-bottom:10px;}
.menu1 span { color:#bb9e55;font-size:12px;}


Go to the top of the page
+Quote Post
ovi_pl
post 6.10.2011, 13:40:27
Post #2





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 20.04.2009
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Może:
Cytat
.menu1 a:hover, .menu1 a:active


Ten post edytował ovi_pl 6.10.2011, 13:41:37


--------------------
www.mountaintrekking.pl
Go to the top of the page
+Quote Post
Mega_88
post 6.10.2011, 13:57:42
Post #3





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Cytat(ovi_pl @ 6.10.2011, 14:40:27 ) *
Może:


Niestety, ale nie chce działać ...
Go to the top of the page
+Quote Post
ovi_pl
post 6.10.2011, 14:11:50
Post #4





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 20.04.2009
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


W takim razie spróbuj zdefiniować tę klasę tak samo jak jest tutaj:
http://www.w3schools.com/cssref/sel_hover.asp


--------------------
www.mountaintrekking.pl
Go to the top of the page
+Quote Post
Mega_88
post 6.10.2011, 14:17:25
Post #5





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Już kombinowałem i z tym nic nie pomogło... Nie mam pojęcia gdzie jest błąd...
Go to the top of the page
+Quote Post
Pawel_W
post 6.10.2011, 15:00:23
Post #6





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

Ostrzeżenie: (0%)
-----


Boże, ludzie...

po prostu aktualnemu odsyłaczowi nadaj klasę .current i ostyluj ją w css tak jak :hover
Go to the top of the page
+Quote Post
Mega_88
post 6.10.2011, 15:44:05
Post #7





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Cytat(Pawel_W @ 6.10.2011, 16:00:23 ) *
Boże, ludzie...

po prostu aktualnemu odsyłaczowi nadaj klasę .current i ostyluj ją w css tak jak :hover


Paweł możesz mi to zrobić na przykładzie ? Przepraszam, ale nie zrozumiałem.
Go to the top of the page
+Quote Post
Pawel_W
post 6.10.2011, 17:18:14
Post #8





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

Ostrzeżenie: (0%)
-----


http://www.pomozalicji.pl/ zobacz jak tam to zrobiłem
Go to the top of the page
+Quote Post
Mega_88
post 6.10.2011, 18:32:07
Post #9





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Cytat(Pawel_W @ 6.10.2011, 18:18:14 ) *
http://www.pomozalicji.pl/ zobacz jak tam to zrobiłem


Paweł... chodzi o to, że stron z tym elementem zrobiłem już dużo i zawsze mi działał, a w tym przypadku nie chce mi przejść. Zrobiłem go troche inaczej i jak pisałem na początku już się pogubiłem. Czy możesz zrobić to na tych liniach kodu, które podałem ?
Go to the top of the page
+Quote Post
Pawel_W
post 6.10.2011, 19:02:59
Post #10





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

Ostrzeżenie: (0%)
-----


nie...

MUSISZ dodać klasę, która będzie wyróżniała aktualny element

może inaczej... spróbuj uzyskać taki efekt na obecnym kodzie BEZ cufona - nie uda Ci się -> nie uda Ci się z cufonem

czy tak ciężko jest zrozumieć o co mi chodzi?

jak jesteś na podstronie "start" to dajesz <a href="start" class="current" style="margin-right:10px"><h3>Start</h3></a> a potem w css stylujesz sobie to tak jak :hover...
Go to the top of the page
+Quote Post
Mega_88
post 7.10.2011, 01:06:04
Post #11





Grupa: Zarejestrowani
Postów: 360
Pomógł: 34
Dołączył: 20.08.2011

Ostrzeżenie: (0%)
-----


Zrobiłęm w ten sposób i nie działa:

Cytat
<?php
if ($id==7 or $id==8 or $id==9) echo
'<div class="menu1">
<a href="start" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="historia" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="srebrna" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="zlota" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="brazowa" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="kontakt" class="current" style="margin-right:0px"><h3>Start</h3></a>
</div>'
?>

.menu1 { float:right; width:720px;height:10px;margin-top:100px;}
.menu1 a, .menu1 span { display:block;float:left;margin-left:5px }
.menu1 a { color:#ffffff;font-size:12px;}
.menu1 a:hover { color:#bb9e55;font-size:12px;padding-bottom:10px;}
.menu1 a:current { color:#bb9e55;font-size:12px;padding-bottom:10px;}
.menu1 span { color:#bb9e55;font-size:12px;}


Zrobiłem też w ten sposób i nie działa:

Cytat
<?php
if ($id==7 or $id==8 or $id==9) echo
'<div class="menu1">
<a href="start" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="historia" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="srebrna" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="zlota" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="brazowa" class="current" style="margin-right:10px"><h3>Start</h3></a>
<a href="kontakt" class="current" style="margin-right:0px"><h3>Start</h3></a>
</div>'
?>

.menu1 { float:right; width:720px;height:10px;margin-top:100px;}
.menu1 a, .menu1 span { display:block;float:left;margin-left:5px }
.menu1 a { color:#ffffff;font-size:12px;}
.menu1 a:hover { color:#bb9e55;font-size:12px;padding-bottom:10px;}
.current { color:#bb9e55;font-size:12px;padding-bottom:10px;}
.menu1 span { color:#bb9e55;font-size:12px;}


Więc o co tu chodzi ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.06.2025 - 02:57