yzerman Posted December 29, 2007 Share Posted December 29, 2007 ok, I am at a loss here. First the code (majority of which is courtesy of labs.mininova.org: <script type="text/javascript"> <!-- var pop = document.getElementById('popup'); var xoffset = 15; var yoffset = 10; document.onmousemove = function(e) { var x, y, right, bottom; try { x = e.pageX; y = e.pageY; } // FF catch(e) { x = event.x; y = event.y; } // IE right = (document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth); bottom = (window.scrollY || document.documentElement.scrollTop || document.body.scrollTop) + (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight); x += xoffset; y += yoffset; if(x > right-pop.offsetWidth) x = right-pop.offsetWidth; if(y > bottom-pop.offsetHeight) y = bottom-pop.offsetHeight; pop.style.top = y+'px'; pop.style.left = x+'px'; } function popup(title, text, img) { pop.innerHTML = "<p><h1>" + title + "</h1><p><img width='100' height='75' src='http://www.mysite.com/uploads/" + img + "'/>" + text + "</p>"; pop.style.display = 'block'; } function popout() { pop.style.display = 'none'; } //--> </script> here is the code for the popup: <style type="text/css"> #popup { background-color:#EEEEEE; border:1px solid #00CC66; display:none; font-size:xx-small; opacity:0.95; position:absolute; width:400px; z-index:30; } </style> <div class="popup" id="popup" style="display:none;"></div> <a class="10" onmouseover="popup('The Title','The body Text','theimage.jpg')" onmouseout="popout()">More Info</a> When I implement this code into the website, and hover over the More Info link, the page jumps around but the div doesnt show unless I hit a certian sweet spot. IE is the problem, Firefox it works just fine. Any ideas? Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 29, 2007 Share Posted December 29, 2007 refer to this thread and in the future; do not double post the exact same thread: http://www.phpfreaks.com/forums/index.php/topic,174675.msg772832.html#msg772832 Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 29, 2007 Share Posted December 29, 2007 I moved this thread from the PHP help area without realizing that he already posted here. I'm locking this thread. Ken Link to comment Share on other sites More sharing options...
Recommended Posts