Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [XHTML + JS] Problem z <option> i onmouseover(), <option> + onmouseover() nie działa
Cadious
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.01.2007

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


Witam,
Mam pewien problem, otóż mam taki fragment kodu:
  1. <option onmouseover="alert(‘Alert1’)"> Alert 1</option>
  2. <option onmouseover="alert(‘Alert2’)"> Alert 2</option>

Niestety zdarzenie onmouseover() nie działa. Czy ktoś mógłby mi wyjaśnić dlaczego i jak można to naprawić.
Go to the top of the page
+Quote Post
pbnan
post
Post #2





Grupa: Zarejestrowani
Postów: 174
Pomógł: 0
Dołączył: 27.03.2007
Skąd: Osiek almost City ;-D

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


  1. <title>bla</title>
  2. </head>
  3.  
  4. <option onmouseover="alert('bla')">Bla</option>
  5.  
  6. </body>
  7. </html>

Testowałem takie coś na FF i działa bardzo sprawnie...
Go to the top of the page
+Quote Post
Cadious
post
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.01.2007

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


Może pod FF ten skrypt działa, ale pod IE i Operą już nie (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
ActivePlayer
post
Post #4





Grupa: Przyjaciele php.pl
Postów: 1 224
Pomógł: 40
Dołączył: 6.07.2004
Skąd: Wuppertal

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


uzyj onchange w seleccie.
  1. <select onchange="alert(this.selectedIndex);">
  2. <option>...</option>

Moga byc bledy, pisane z palca
Go to the top of the page
+Quote Post
ferr
post
Post #5





Grupa: Zarejestrowani
Postów: 122
Pomógł: 3
Dołączył: 18.12.2004

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


klik - co nieco o Twoim problemie.
Go to the top of the page
+Quote Post
Cadious
post
Post #6





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.01.2007

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


Nie do końca oto mi chodzi. Chciałbym żeby po najechaniu kursorem na jeden z elementów <option> była wywoływana jakaś funkcja .
Go to the top of the page
+Quote Post
pbnan
post
Post #7





Grupa: Zarejestrowani
Postów: 174
Pomógł: 0
Dołączył: 27.03.2007
Skąd: Osiek almost City ;-D

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


Sądzę, że taki efekt możesz uzyskać łącząc możliwości, jakie daje HTML DOM Event oraz <select onmousemove=""> (tak, SELECT nie OPTION).

http://w3schools.com/htmldom/dom_obj_event.asp szczególnie od Other Event Attributes w dół (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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: 28.09.2025 - 12:27