Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] zmiana podświetlenia bg komórki tabeli
shpaque
post
Post #1





Grupa: Zarejestrowani
Postów: 651
Pomógł: 3
Dołączył: 31.01.2011
Skąd: Warszawa

Ostrzeżenie: (10%)
X----


Witam serdecznie, chciałbym żeby po najechaniu myszką zmienił mi się bacground w danej komórce tabeli. Mam coś takiego ale nie działa (rozumiem, że ma być wywołane PO td komórki?):

  1. <script type="text/javascript">
  2. $(document).ready(function()
  3. {
  4. $(this).hover(function()
  5. {
  6. $(this).stop().animate({"background-color": #CCCCCC}, 100);
  7. },
  8. function()
  9. {
  10. $(this).stop().animate({"background-color": transparent}, 20000);
  11. });
  12. });
  13. </script>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




A mi dziala
Kod
$(document).ready(function()

   {

      $('#wb_uid0').hover(function()

         {

            $('#wb_uid0').css({"background-color": "#CCCCCC"});

         },

      function()

         {

            $('#wb_uid0').css({"background-color": "transparent"});

         });

});


O wstawce w dokumentacji nie wspominajac
http://api.jquery.com/animate/
Cytat
All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used).

No ale po co zagladac do konsoli js oraz dokumentacji...
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 15.10.2025 - 12:43