Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> dymki - poprawa skryptu
cornholio666
post
Post #1





Grupa: Zarejestrowani
Postów: 472
Pomógł: 8
Dołączył: 14.03.2004
Skąd: Rzeszów

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


Witam.

Znalazlem skrypt ktory ma wyswietlac dymek po najechaniu na link:

  1. <style type="text/css">
  2. .chmurka {
  3. position:absolute;
  4. border:1px double #000;
  5. background:#FF6600;
  6. padding:1px;
  7. font:normal normal 9px Verdana, sans-serif;
  8. }
  9.  
  10. <!--<script type="text/javascript">
  11. function chmurka(e,v)
  12. {
  13. if(v.title)
  14. {
  15. var t=document.createElement("div");
  16. t.className="chmurka";
  17. t.innerHTML=v.title;v.title="";
  18. v.move=function(e)
  19. {
  20. e=e||event;
  21. t.style.left=e.clientX+20+"px";
  22. t.style.top=e.clientY+20+"px";
  23. }
  24. v.move(e);
  25. document.body.appendChild(t);
  26. v.onmousemove=function(e){v.move(e)}
  27. v.onmouseout=function(e)
  28. {
  29. v.title=t.innerHTML;
  30. document.body.removeChild(t);
  31. document.body.scrollTop;
  32. }
  33. }
  34. }
  35. </script>
  36. </head>
  37. <body>
  38. <a href="cos.html" title="Ale fajny opis" onmouseover="chmurka(event,this)">link</a>
  39. </body>


teraz cytat: Omawiany dymek działa w porządku, ale tylko kiedy strona nie jest scrollowana; niestety po scrollowaniu pozycja dymka głupieje i nie wyświetla się on poprawnie.

trzeba dodać linijkę document.body.scrollTop


I teraz pytanie: Gdzie trzeba dodac ta linijke?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
Sabistik
post
Post #2


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

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


Moze nie do konca na temat, ale ja do tooltipow uzywam tej biblioteki. Nie mam z nia zadnych problemow. Niesamowicie konfikuralna i funkcjonalna.
Go to the top of the page
+Quote Post
cornholio666
post
Post #3





Grupa: Zarejestrowani
Postów: 472
Pomógł: 8
Dołączył: 14.03.2004
Skąd: Rzeszów

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


Podoba mi sie ale nie moge tego odpalic. Nie moge sie doczytac gdzie mam wrzucic sciagniete pliki wiec wrzucilem do katalogu glownego.W tym samym katalogu mam plik cos.html:

  1. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  2. <script type="text/javascript" src="overlib.js">
  3. <!-- overLIB (c) Erik Bosrup -->
  4.  
  5. </head>
  6. <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
  7.  
  8. <a href="javascript:void(0);" onmouseover="return overlib('This is an ordinary
  9. popup.');" onmouseout="return nd();">here</a>
  10.  
  11. <a href="javascript:void(0);" onmouseover="return overlib('This is what
  12. we call a sticky, since I stick around (it goes away if you move the mouse
  13. OVER and then OFF the overLIB popup--or mouseover another overLIB).',
  14. STICKY, MOUSEOFF);" onmouseout="return nd();">here</a>
  15.  
  16. <a href="javascript:void(0);" onclick="return overlib('This is a sticky
  17. with a caption. And it is centered under the mouse!', STICKY, CAPTION,
  18. 'Sticky!', CENTER);" onmouseout="nd();">Click here!</a>
  19.  
  20.  
  21. </form>
  22. </body>
  23. </html>


Niestety dymki sie nie pojawiaja. Moze mi podpowiesz co robie zle?
Go to the top of the page
+Quote Post
Sabistik
post
Post #4


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

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


nie mozesz lamac lini:
Kod
return overlib('This is an ordinary
popup.');"


to musi byc w jednej lini:
Kod
return overlib('This is an ordinary popup.');"


caly link:

  1. <a href="javascript:void(0);" onmouseover="return overlib('This is an ordinary popup.');" onmouseout="return nd();">here</a>
Go to the top of the page
+Quote Post
cornholio666
post
Post #5





Grupa: Zarejestrowani
Postów: 472
Pomógł: 8
Dołączył: 14.03.2004
Skąd: Rzeszów

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


ok dziala ladnie (IMG:http://forum.php.pl/style_emoticons/default/guitar.gif) dzieki
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 - 20:48