SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2013
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy on mouseover on table cell to display another table in popup

    I want to display a table which is in php file to be display when mouse hover on another table cell.

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Quote Originally Posted by raghav472 View Post
    I want to display a table which is in php file to be display when mouse hover on another table cell.
    You could do somethinglike this:

    Code:
    <!DOCTYPE HTML>
    <html>
      <head>
        <meta charset="utf-8">
        <title>Table cell hover</title>
      </head>
      
      <body>
        <table>
          <tr>
            <td id="myCell">row 1, cell 1</td>
            <td>row 1, cell 2</td>
          </tr>
        </table>
    
        <script>
         // Get table via AJAX here
    
          var cell = document.getElementById("myCell");
          cell.addEventListener('mouseover', function(){
             // display table here
          });
        </script>
      </body>
    </html>
    I would get the table once the page has loaded via AJAX, then use the above structure to display it whenever anyone mouses over the cell in question.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •