Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][HTML][CSS]Tekst po najechaniu
Sebastian003
post
Post #1





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

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


Jak zrobić aby po najechaniu myszka ten tekst sie rozwijał ?

  1. <h2>
  2. <div class="bms" onclick="ne('o1')">pokaż/ukryj</div>
  3. <div id="o1" style="display:none;">
  4. <p>
  5. tekst
  6. </p>
  7. </div>
  8. </h2>
  9.  
  10. <script type="text/javascript">
  11.  
  12. function ne(o){
  13. if(document.getElementById(o).style.display=='') document.getElementById(o).style.display = 'none';
  14. else document.getElementById(o).style.display='';
  15. }
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 8)
elmozaur
post
Post #2





Grupa: Zarejestrowani
Postów: 518
Pomógł: 18
Dołączył: 21.07.2008

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


http://api.jquery.com/toggle/
Go to the top of the page
+Quote Post
Sebastian003
post
Post #3





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

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


Ale po najechaniu nie kliknięciu ?
Go to the top of the page
+Quote Post
Comandeer
post
Post #4





Grupa: Zarejestrowani
Postów: 1 268
Pomógł: 254
Dołączył: 11.06.2009
Skąd: Świętochłowice

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


.bms:hover + div { display: block; }?
Go to the top of the page
+Quote Post
Sebastian003
post
Post #5





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

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


to najechaniu rozwiniecie...
Go to the top of the page
+Quote Post
Comandeer
post
Post #6





Grupa: Zarejestrowani
Postów: 1 268
Pomógł: 254
Dołączył: 11.06.2009
Skąd: Świętochłowice

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


No to choćby transition na height
Go to the top of the page
+Quote Post
Rysh
post
Post #7





Grupa: Zarejestrowani
Postów: 821
Pomógł: 111
Dołączył: 11.09.2006
Skąd: Biała Podlaska

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


Cytat(Comandeer @ 28.07.2016, 21:12:33 ) *
No to choćby transition na height

Jak coś się da osiągnąć CSS to tym to rób, czyli tak jak kolega napisał + oczywiście :hover.
Go to the top of the page
+Quote Post
Sebastian003
post
Post #8





Grupa: Zarejestrowani
Postów: 282
Pomógł: 2
Dołączył: 22.03.2007

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


A dokladnie jak to uzyc aby sie wysuwało bo nie wychodzi mi ?
Go to the top of the page
+Quote Post
Rysh
post
Post #9





Grupa: Zarejestrowani
Postów: 821
Pomógł: 111
Dołączył: 11.09.2006
Skąd: Biała Podlaska

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


Chyba nie zapisałem poprawnej wersji:
https://jsfiddle.net/tmLu4na5/2/

Ten post edytował Rysh 30.07.2016, 10:56:20
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: 22.08.2025 - 19:50