Jump to content

mouseover pop up box using text file


bobvaz

Recommended Posts

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.

Link to comment
Share on other sites

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');
}

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.