![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 262 Pomógł: 5 Dołączył: 8.02.2005 Skąd: Olsztyn / Zatorze Ostrzeżenie: (0%) ![]() ![]() |
witam!
Szukam porady / źródeł / tutoriali itp. jak zrobić taki patent by po kliknięciu na link wyświetliła by mi sie warstwa (div) obok kursora ale by się nie przemieszczała razem z nim ... dodatkowo do javascript musze pobierać znaczniki po klasie (a nie po ID lub NAME)... MAcie jakieś pomysły (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ? |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 262 Pomógł: 5 Dołączył: 8.02.2005 Skąd: Olsztyn / Zatorze Ostrzeżenie: (0%) ![]() ![]() |
Hmmm na ID niby działa ale gdy zamiast ID podstawie klase tak jak wyżej napisałeś to niestety ten kod nie działą (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Kod <html> <head> <script type="text/javascript"> function pos() { if (window.Event) { document.captureEvents(Event.MOUSEMOVE); } document.getElementByClassName("test").onmousemove = function(e){ x = (window.Event) ? e.pageX : event.clientX; y = (window.Event) ? e.pageY : event.clientY; document.getElementByClassName("head").style.left=x - 5; document.getElementByClassName("head").style.top=y - 15; document.getElementByClassName("head").style.display="block"; document.getElementByClassName("w").innerHTML="mouseX:"+x+"<br />mouseY:"+y; } document.getElementByClassName("test").onmouseout=function() { document.getElementByClassName("head").style.display="none"; } } window.onload = pos; </script> <style type="text/css"> div.head { width:50px; height:10px; background-color:red; position:absolute; display:none; z-index:1; } div.test { width:200px; height:100px; position:absolute; left:100px; top:300px; background-color:blue; z-index:0; } </style> </head> <body> <div class="head"></div> <span class="w"></span> <div class="test"> </div> </body> </html> czemu nie działą właśność getElementByClassName (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 15.10.2025 - 05:54 |