Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Jak dodac po najechaniu na link podswietlenie?
wozniak
post
Post #1





Grupa: Zarejestrowani
Postów: 278
Pomógł: 0
Dołączył: 21.11.2003

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


Witam mam taki skrypt ktory wyswietla kategorie i jak zrobic takie cos ze jak sie najedzie na jakas nazwe kat. to ta nazwa sie podswietli na jakis kolor np. na zielony co typu <td bgcolor="jakistam">Nazwa_kat</td>
A taki skrypt jest np. na www.hipermax.pl
KOD:
http://forum.php.pl/index.php?act=ST&f=1&t=28299
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
SongoQ
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Napisalem sobie taki skrypcik ktory mi podswietla wiersze, gdzie kolorki wystepuja na przemian.

  1. <?php
  2.  
  3.  
  4. function Light(p_rElement, p_szAction, p_iCount)
  5. {
  6.    var theCells = null;
  7.    var szColor = null;
  8.                 
  9.    if(p_szAction != 'on')
  10.    {
  11.       if(p_iCount == 0)
  12.     szColor = '#F0F5FA';
  13.       else
  14.     szColor = '#FAFCFD';
  15.    }
  16.    else
  17.     szColor = '#D4EAFB';
  18.                 
  19.     if(typeof(document.getElementsByTagName) != 'undefined')
  20.       theCells = p_rElement.getElementsByTagName('td');
  21.     else if(typeof(p_rElement.cells) != 'undefined')
  22.      theCells = p_rElement.cells;
  23.                 
  24.     if(typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined')
  25.       domDetect    = true;
  26.     else
  27.       domDetect    = false;
  28.                     
  29.     for(= 0; i < theCells.length; i++)
  30.    {
  31.      if(domDetect)
  32.        theCells[i].style.backgroundColor = szColor;
  33.     else
  34.        theCells[i].setAttribute('bgcolor', szColor, 0);
  35.     }                
  36. }
  37.  
  38.  
  39. ?>


Cos mi sie zle wstawilo, oczywiscie to jest skrypt JS

Ten post edytował SongoQ 27.03.2005, 22:24:44
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 5.10.2025 - 11:16