Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][CSS] Przesuwanie
--Baltazar--
post 3.05.2011, 12:41:45
Post #1





Goście







Witam pokąbinowałem i wyszło coś takiego :

  1. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  2. <style type='text/css'>
  3. body
  4. {
  5. background-color:silver;
  6. }
  7. .divek
  8. {
  9. position: absolute;
  10. background-color:lightgray;
  11. width:250px;
  12. height:100px;
  13. border:solid 5px lightgray;
  14. top:50px;
  15. left:400px;
  16.  
  17. }
  18. .dymek
  19. {
  20.  
  21. background-color:gray;
  22. width:250px;
  23. height:30px;
  24. border:solid 2px #eeeeff;
  25. top:40px;
  26. left:400px;
  27.  
  28. cursor: move;
  29. }
  30.  
  31. <script type="text/javascript">
  32.  
  33. function move(evt)
  34. {
  35. if(evt.button)
  36. {
  37.  
  38. var posx;
  39. var poxy;
  40. if (evt.clientX || evt.clientY)
  41. {
  42. posx= evt.clientX;
  43. posy= evt.clientY;
  44. }
  45.  
  46.  
  47.  
  48. document.getElementById("okno").style.left=posx-125 ;
  49. document.getElementById("okno").style.top=posy-20;
  50. }
  51.  
  52. }
  53. </head>
  54. <div class="divek" id="okno">
  55. <div class="dymek" onmousemove="move(event);" ><p style="text-align: center">Nazwa aplikacji</p></div>
  56. </div>
  57.  
  58. </body>
  59. </html>


Co zrobić by tak samo działało w chromie , firefoxie i ie ?
Jak zrobić by element nie mógł wyjść za stronę?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
bogusborek
post 3.05.2011, 16:10:50
Post #2





Grupa: Zarejestrowani
Postów: 10
Pomógł: 1
Dołączył: 6.01.2010

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


musisz ściągnąć cssy do ie
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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 02:24