SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    UK
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wanted: Unobtrusive tooltip script to apply tooltip to elements of particular class

    Hi,

    I've found loads of good tooltip scripts which apply tooltips to every element with a title attribute, or any element of a particular id. However, XHTML defines that there can't be repeat ids in a single page e.g.

    Code:
    <a href="" id="tooltip" title="Link with tooltip">Link with tooltip</a>
    <a href="" id="tooltip" title="Another link with tooltip">Another link with tooltip</a>
    plus I don't want tooltips to appear on every element on the page where I have title attributes (it would look messy on my main navigation for example).

    What I want to do is find a script which applies a tooltip to all elements with a particular class. e.g.

    Code:
    <a href="example.com" title="This link should have no tooltip">This link should have no tooltip</a>
    
    <a href="example.com" title="This link should have a tooltip" class="tooltip">This link should have a tooltip</a>
    
    <a href="example.com" title="This link should also have a tooltip" class="tooltip">This link should also have a tooltip</a>
    This way, I can control which elements on the page have a tooltip in a valid XHTML way.


    Does such a script exist, if so, where?

    My Javascript skills are zero, so I wouldn't like to attempt to code this myself.

    Thanks for any help guys...

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi danwednesday,

    Have a look at this demo: xTooltipGroup.



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
  •