bobvaz Posted May 18, 2009 Share Posted May 18, 2009 I am looking for help on creating a pop up box which displays information from a text file (updated daily by cms appl) when the visitor places the mouse over a text field on the screen. Have searched, but only find tutorials and info on popup windows which require clicking to display and clicking to exit. Would much rather have mouseover, mouseout functions. Any help or direction will be appreciated. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted May 18, 2009 Share Posted May 18, 2009 function onmouseover(){ newdiv=document.createElement('div'); newdiv.id = 'thepopup'; newdiv.style = 'position: absolute; top: 40%; left: 40%;'; newimg.onclick=closebox(); //JQUERY $.ajax({ type: "POST", url: "getmypopupcontent.php", data: "name=John&location=Boston", success: function(msg){ newdiv.innerHTML = msg; }); document.body.appendChild(newdiv); } function closebox(){ document.body.removeChild('thepopup'); } Quote Link to comment Share on other sites More sharing options...
Axeia Posted May 18, 2009 Share Posted May 18, 2009 any onclick should allow itself to be changed to an onclick quite easily. In fact you don't need even need javascript for a hover if the 'target' is a link. (Or if you're willing to screw over IE6 users.. at least I think ie7 had proper :hover support on ANY element instead of just links.. but not sure). What exactly are you after? Something simple like http://meyerweb.com/eric/css/edge/popups/demo.html a short line of text? Or half a page worth of information in a complex table layout? Quote Link to comment Share on other sites More sharing options...
bobvaz Posted May 18, 2009 Author Share Posted May 18, 2009 For a country club, i have employees update text files which indicate the golf course conditions, tennic court conditions, fitness center updates, swim club updates, etc....would like to have visitors mouse over each of these and display the text in each of the text files for that venue. The file is not large. maybe 6-7 lines Quote Link to comment Share on other sites More sharing options...
Axeia Posted May 18, 2009 Share Posted May 18, 2009 Well check out meyers css menus Just let php read the text files and use the css technique (as with meyers menus) to hide them. If you really want to load the file then yeah nadeemshafi9's approach should work, will be inaccessible to those without javascript though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.