SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    Non-Member
    Join Date
    Nov 2010
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how is tooltip control to display text?

    Hello
    How i can write code that, If in place table->td(s) the characters more than 20 character tooltip load?
    for each td that the number of characters more than 20

    What are your ideas?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by binboy View Post
    Hello
    How i can write code that, If in place table->td(s) the characters more than 20 character tooltip load?
    for each td that the number of characters more than 20

    What are your ideas?
    Well first of all, will 20 i's be larger than 20 W's?

    iiiiiiiiiiiiiiiiiiii
    WWWWWWWWWWWWWWWWWWWW

    Second, why do you need tooltips to load? Is it due to the content being in danger of overflowing off the element? If so, that can be checked for programmatically so that the 20 character problem no longer becomes a problem.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    Non-Member
    Join Date
    Nov 2010
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    20 is an example, the number is not specified. The 150 is more likely
    I need to display values ​​from database tooltip that their length is much

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    First you gain a reference to the element within which the text is contained.
    Then you can use nodeValue or innerHTML to retrieve the content.
    Based on the length of the content, you can then set a title property of the container.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    Non-Member
    Join Date
    Nov 2010
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How is in the jQuery?

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by binboy View Post
    How is in the jQuery?
    If you take a go at it and let us know when you're having troubles, we'll help you through them.

    If instead you're looking for someone to do all the work for you, there are places like the Marketplace
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •