Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> css + js pytanie o diva, który by nie przesuwał strony
Civil
post
Post #1





Grupa: Zarejestrowani
Postów: 86
Pomógł: 1
Dołączył: 19.09.2006
Skąd: Wrocław

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


Witam.

Mam

  1. <script language="Javascript">
  2. function toggleDiv(id,flagit) {
  3. if (flagit=="1"){
  4. if (document.layers) document.layers[''+id+''].visibility = "show"
  5. else if (document.all) document.all[''+id+''].style.visibility = "visible"
  6. else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
  7.  
  8. if (document.layers) document.layers[''+id+''].display = "block"
  9. else if (document.all) document.all[''+id+''].display= "block"
  10. else if (document.getElementById) document.getElementById(''+id+'').style.display= "block"
  11.  
  12.  
  13. }
  14. else
  15. if (flagit=="0"){
  16. if (document.layers) document.layers[''+id+''].visibility = "hide"
  17. else if (document.all) document.all[''+id+''].style.visibility = "hidden"
  18. else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
  19.  
  20. if (document.layers) document.layers[''+id+''].display = "none"
  21. else if (document.all) document.all[''+id+''].style.display = "none"
  22. else if (document.getElementById) document.getElementById(''+id+'').style.display = "none"
  23.  
  24. }
  25. }


oraz

  1. <td><a href=\"#\" onMouseOver=\"toggleDiv('zmiany$tr[id]',1)\" onMouseOut=\"toggleDiv('zmiany$tr[id]',0)\"><img src=hz.jpg border=0></a></td>
  2. </tr>
  3. <tr><td colspan=10>
  4. <div id='zmiany$tr[id]' style='visibility:hidden;display:none;position:relative;left:20%;top:20px;width:500px;background-color:black;border:1px solid white;padding:5px'>";
  5. costam
  6.  
  7. </div>


Po najechaniu na przycisk pokazuje sie div (w formie dymka) - tyle, ze jest on zagniezdzony w tabelce i przesuwa wszystko w dol, zas jak sie da absolute albo fixed to jest za kazdym razem w tej samej pozycji a ja mam tabelke, ktora generuje parenascie rekordow i chce by div bez znaczenie jaka jest rozdzielczosc pojawial sie w okolicach przycisku HZ ALE NIE PRZESUWAL calej strony w dol, jak to zrobic?
Go to the top of the page
+Quote Post
tiraeth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 789
Pomógł: 41
Dołączył: 30.10.2003
Skąd: Wrocław

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


Ustaw dla elementu nadrzędnego css position:relative, a potem w swoim divie position:absolute; top:2em; left:0 i zobacz czy takie coś Ci pasuje.
Go to the top of the page
+Quote Post
Civil
post
Post #3





Grupa: Zarejestrowani
Postów: 86
Pomógł: 1
Dołączył: 19.09.2006
Skąd: Wrocław

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


Tak, o właśnie coś takiego mi chodziło, teraz DiV nie rozpycha strony. Dziękuję.
Go to the top of the page
+Quote Post

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: 19.08.2025 - 18:09