Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> onmouseout, elementy
GrayHat
post
Post #1





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


problem dotyczy sie takiego kodu:

  1. <script language="JavaScript">
  2.  
  3. function findPos(el) {
  4. var obj=document.getElementById(el);
  5. var curleft = curtop = 0;
  6. if (obj.offsetParent) {
  7. curleft = obj.offsetLeft
  8. curtop = obj.offsetTop
  9. while (obj = obj.offsetParent) {
  10. curleft += obj.offsetLeft
  11. curtop += obj.offsetTop
  12. }
  13. }
  14. return [curleft,curtop-70];
  15. }
  16.  
  17. function show(what){
  18. var pos = findPos(what);
  19. document.getElementById('tipDiv').style.display = 'block';
  20. document.getElementById('tipDiv').style.left = pos[0]-30;
  21. document.getElementById('tipDiv').style.top = pos[1];
  22. }
  23.  
  24. function hide(){
  25. document.getElementById('tipDiv').style.display = 'none';
  26. }
  27. span { margin-left: 50px; }
  28. <div style="width:500px;margin:100px auto;text-align:center;">
  29.  
  30. <div id="tipDiv" onmouseout="hide()" style="background: yellow; position:absolute; border: solid 1px red; width: 100px; height: 200; display: none;">
  31. div div div
  32.  
  33. <input type="text"/>
  34. </div>
  35.  
  36.  
  37. <span onmouseover="show('over')" id="over">siema</span> <span onmouseover="show('o1')" id="o1">siema</span> <span onmouseover="show('o2')" id="o2">siema</span> <span onmouseover="show('o3')" id="o3">siema</span>
  38. </div>


i problem jest w akcji onmouseout divka... chce zeby akcja sie wykonala jezeli myszka zjedzie z tego divka poza jego obszar a obecnie dziala nawet jak wjedzie na element w tym divku (input)...

prosze o pomoc


--------------------
*Note: No animals were killed durning the construction of this post.
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 - 04:09