SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Mar 2001
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How does phpMyAdmin do the highlighting?

    You know how in phpMyAdmin when you browse a table, if you hover over a row, it is highlighted, how is that effect done? Straight html? CSS? Javascript? What's the code?

    Thanks so much!

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    This thread, http://www.sitepointforum.com/showth...threadid=50826 should show you what you are looking for. There is another more recent one, I'll have quick look for that one now, watch this space!

    Glen

  3. #3
    SitePoint Addict
    Join Date
    Mar 2001
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Glen. Hmm, while you were searching I tried a couple of those, but I'm trying to get it exactly like phpMyAdmin, highlighting the whole row not just the cell...preferably w/o any javascript at the header of the page (I've had numerous problems w/ javascript fighting each other in the past and am scared of using that <script> tag!)

    I'll keep trying some stuff from that page tho'!

  4. #4
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you are trying to change something dynamcially after the page has loaded, so I'm afraid you havent really got many options other than using those dreaded <script> tags

    You basically just have 2 different styles on your CSS, one for each state the row will be in and using javascript to actually change the styles over using the mouseover command.

    How to do a whole row though, Im not to sure, see if you can apply the same code you have to the tr rather than the td. *looks around for Ian's advice *

  5. #5
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tend to use js for this as I like it.

    <tr onmouseover="this.style.background='silver'" onmouseout="this.style.background='white'">
    <td>This is a cell</td>
    <td>And so is this</td>
    </tr>

    That shoudl do it for you unless I have made some strange typo
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  6. #6
    SitePoint Addict
    Join Date
    Mar 2001
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh excellent! No <script> tag on top??

  7. #7
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by dwh
    Oh excellent! No <script> tag on top??
    Nope. It is inline. You could design it to use a function instead. It is more efficient that way. But for the ease of use and a quick display that works as is.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like this

    PHP Code:
    <script type="text/javascript">

      function 
    high(obj,colour)
      {
        
    obj.style.backgroundColor=colour;
      }

    </script>

    <a href="link.html" onmouseover="high(this,'orange')" onmouseout="high(this,'white')" style="color:black">link</a> 

  9. #9
    SitePoint Addict
    Join Date
    Mar 2001
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I tried it but it wouldn't work when I had an alternating bgcolor on each td...when I pulled it out it did work... but until the mouseover it looks a bit weird...the <tr> is generated by a script so I can't stick in an alternating bgcolor on each <tr> as I believe phpMyAdmin did.

    And it's so annoying but on this new Dell Machine I can't view source on IE 6.0, it doesn't work (nor does zoom in on pics)...so it's killer on debugging...

  10. #10
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's nothing to do with dell besides the software. check out the registry.

    are you trying to use this on another obj?


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
  •