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:
I would have just used the split function and use arrays , , etc... Which is what I originally did, but then I was thinking what if those settings were ordered differently, it would not work.
<a href="#" class="tooltip" rel="width:100::direction:top::content:unique-id2" />
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.
you could use the html attribute tag
or you could use JSON notation inside the rel tag.
Anyone? Any help would be greatly appreciated I was thinking substring, search and etc... but as you can tell its not working correctly.
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.
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
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)