|
Best way to setup qtip use
|
|
15th December, 08:50
Post: #1
|
|||
|
|||
|
Best way to setup qtip use
I have just started looking at qtip, and so far it seems to do what I want
![]() I'd better start with a description of what I need to do. I have a image, and on top of this image, I want to playce numerous div tags (with a background and other effects). On each of these div tags, I want to show a tooltip on mouseover. The content for each of these divtags is ofcourse different, and are based on our CMS. But basically I need to be able to set the content for each tooltip. I want to keep the code as short and clean as I can, but I cant quite figure out how to set 10+ tooltips that need to have the same look, without having lots of redundant code. I saw in another post on the forums that you can use the object $.fn.qtip.defaults to override the defaults with your own - but I cant get it working. How would you setup the HTML and javascript? Right now I have a div containing the image, and x number of div's. My stylesheet then position the t_tooltip_X divs on top of the image, and the javascript you can see further below adds qtip tooltips to everything with the t_tip class. JS Code
It is my intention to set the content of each of the tooltip's refrencing the ID of the div tag afterwards. I have tried to use the API to access the content of a given tooltip, but this seems buggy, or at least I cant figure out why it does not work. JS Code
This is the tooltip code I have tried. As you can see, I have tried to use the api at the bottom, after I have added the tooltips. But when I view the page, the tooltip content does not update. However, if I copy and paste the following into the Firebug console and run it, the tooltip content is updated just fine. Is this a bug or am I just not using the API right? JS Code
Is there a better and more efficient way todo what I am trying to do? |
|||
|
15th December, 13:34
Post: #2
|
|||
|
|||
|
Best way to setup qtip use
Hey SuneR,
Take a look at this code, it should be helpful to you. Basically it's pretty similar to what you've done, except it uses a custom defaults object which is safer in this sense, since you're never overwriting the actual defaults with possible null/wrong values. JS Code
Craig Thompson Web Developer / Designer Craigsworks http://www.craigsworks.com |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Simple qTip setup but doesn't appear to like IE7 | mparter | 2 | 1,718 |
12th April 17:17 Last Post: mparter |
|
User(s) browsing this thread: 1 Guest(s)

Search
Member List
Calendar
Help






