Results 1 to 4 of 4

Thread: String Help

  1. #1
    Join Date
    Aug 2008

    String Help

    Hello, so I am building a custom tooltip and Im having trouble passing values in. I want to be able to give a set width and the direction of where it should show up. here is how it is structured:

    HTML Code:
    <a href="#" class="tooltip" rel="width:100::direction:top::content:unique-id2" />
    I would have just used the split function and use arrays [0], [1], etc... Which is what I originally did, but then I was thinking what if those settings were ordered differently, it would not work.

    Here is a link to what I have now. Since I already built it everything is there, but I just need to refactor since I am solving this issue of using strings and not arrays. I commented out things that are not really relevant to the solution. If anyone could help that would be great thanks.


  2. #2
    Join Date
    Jan 2004
    you could use the
    html attribute tag
    or you could use JSON notation inside the rel tag.
    Natdrip :P
    "water go down the hole" - plucky duck

  3. #3
    Join Date
    Aug 2008
    Anyone? Any help would be greatly appreciated I was thinking substring, search and etc... but as you can tell its not working correctly.

  4. #4
    Join Date
    Apr 2006
    FireFox 6.0 does nothing but show plain text, some in large font, and three do-nothing
    links. it complains about ML.Tooltip.createTooltip(activate[i].name, activate[i]); not being
    a function. As you said, there are some sections commented out, such as this function.

    <snip>10 minutes</snip>

    I read your post a few more times and read the article mentioned by Natdrip. Now I see
    that you want to know the best way to assign data to an object for which you want
    custom tooltips.

    Initially I can divide the answer into two parts: inline (internal as your given example) and
    external as in an array.

    The benefit of an external data array is that information is in one location and can be
    applied to all objects as needed. inline unique data hides deep within a page and may be
    more difficult to change on a large scale - several global changes.

    The DATA idea from Natdrip is probably the best idea as that is what the attribute was
    designed for but many people will not have access to HTML5 until they bother to upgrade.

    At the moment I do not have any concrete suggestions to offer even though I am
    inclined towards an array of global data affecting specific objects when required. That is,
    simply apply a mouse over and out event to your objects which calls a function with
    identification of the calling object which applies the tooltip data extracted from a group

    I'd suggest looking at several other custom tooltip systems and implementing their idea,
    not necessarily copying directly, merely ascertaining how they solved the same problem.
    Colin Fiat Simple Solutions To Complex Problems

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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