Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] Onmouseover - zwiększenie wymiarów diva po najechaniu kursorem
Age1869
post
Post #1





Grupa: Zarejestrowani
Postów: 118
Pomógł: 6
Dołączył: 25.10.2010
Skąd: Radzyn Podlaski

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


Witam, nie znam kompletnie JS, zawsze go unikałem jak ognia i w konsekwencji nie mam o nim pojęcia. Muszę go natomiast zastosować. Chodzi o wybór języka. Są 4 flagi, domyślnie ma się wyświetlać tylko jedna, ale po najechaniu na nią mają się pokazywać pod nią dodatkowe trzy. Znalazłem jakiś gotowy kod JS i próbowałem go przerobić. Niestety nie działa. Będę wdzięczny za pomoc.

JS:
  1. <script language="Javascript">
  2.  
  3. <!--
  4.  
  5. function toggleDiv(id,flagit) {
  6.  
  7. if (flagit=="1"){
  8.  
  9. if (document.layers) { document.layers[''+id+''].height = "92px";
  10. document.layers[''+id+''].visibility = "show"; }
  11.  
  12. else if (document.all) { document.all[''+id+''].style.height = "92px"; document.all[''+id+''].style.visibility = "visible"; }
  13.  
  14. else if (document.getElementById) { document.getElementById(''+id+'').style.height = "92px"; document.getElementById(''+id+'').style.visibility = "visible"; }
  15.  
  16. }
  17.  
  18. else
  19.  
  20. if (flagit=="0"){
  21.  
  22. if (document.layers) { document.layers[''+id+''].height = "34px"; document.layers[''+id+''].visibility = "show"; }
  23.  
  24. else if (document.all) { document.all[''+id+''].style.height = "34px"; document.all[''+id+''].style.visibility = "visible"; }
  25.  
  26. else if (document.getElementById) { document.getElementById(''+id+'').style.height = "34px"; document.getElementById(''+id+'').style.visibility = "visible"; }
  27.  
  28. }
  29.  
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36. //-->
  37.  
  38. </script>


HTML:
  1. <div id="jezyk" onMouseOver="toggleDiv('jezyk',1)" onMouseOut="toggleDiv('jezyk',0)">tutaj są flagi</div>


CSS:
  1. #jezyk {
  2. width: 40px;
  3. height: 34px;
  4. z-index: 10;
  5. }


Z góry dzięki!
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: 22.08.2025 - 18:57