Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
<area> element challenge
19th March, 04:45
Post: #1
<area> element challenge
The navigation area of my client's web pages is a <map> element composed of polygonal <area> elements. Not surprisingly, qTips do not work on such targets, no doubt because they don't conform to the rectangular position.corner model qTip uses.

So...is there any way to position a qTip at a particular x-y point? Using jQuery I can obtain the particular point on the polygon that I would like the qTip to target, but I don't see any way to actually do it.

Thanks for any suggestions.
Find all posts by this user
Quote this message in a reply
19th March, 14:42
Post: #2
<area> element challenge
blisshome,

This is actually a feature I would very much like to look into, as it apepars very few tooltip scripts actually work with <area> elements. I'll look into it and slate it as proposed for beta4. Let me get back to you with a possible beta3 fix for it so you don't have to wait.

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
19th March, 21:31 (This post was last modified: 20th March 20:21 by phlux0r.)
Post: #3
<area> element challenge
craig Wrote:blisshome,

This is actually a feature I would very much like to look into...

I hacked the Beta3 code a bit and actually got a tootip to appear in response to a mouseover over a polygonal area. Unfortunately it was appearing way down in the bottom left part of the window, partly offscreen. When I tried to correct for the screen positioning, it stopped working altogether.

FWIW, here's what I tried:

1. Created an fourth position.corner attribute called "polyarea" and put it right after "mouse in the beforeUpdate function.

2. Used target.attr('coords').split(',') to get the topmost right vertex of the polygon (that's peculiar to my needs; it could be generalized)

3. Set the target's corner to "topRight" and tooltip's corner to "bottomLeft"

4. Set target's posX and posY (i.e., offset().left and offset().right) to the vertex I got in step 2.

5. Stored the target's outerWidth() and target's outerHeight() in two variables (outerWidthTarget and outerWidthHeight). I did this in the HTML section, as well as faked it in the polyarea code section since the latter has no real width or height.

6. Wherever the target's offset(), outerWidth(), and outerHeight() calls were made, I substituted the variables created in the steps above.

Singing the newbie blues: Does this approach seem promising, or am I way off base?

*******************
Update 3/20/09:
*******************
It actually works! The code hadn't stopped working, but the positioning was still off, except that instead of half off the window to the lower left, the qTip had moved to the upper left and half off, where my downscrolling was preventing me from seeing it.

So, I revisited the target.offset() values and realized I had forgotten to include them in my posX and posY calculation. With Top and Left from the Offset added to these numbers the tip appears just where they should!

Joy.
Find all posts by this user
Quote this message in a reply
21st March, 12:32
Post: #4
<area> element challenge
blisshome,

You beat me to it! Would you mind emailing me the source code so I can take a look over the changes you made? I want to implement this ready for beta4. Cheers.

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] How to append QTip to some other element instead of document body prateekbansal 2 179 11th January 07:01
Last Post: prateekbansal
  [Solved] QTip content from existing div element on page? dcash 4 1,868 8th December 18:29
Last Post: Craig
  nested lists and qtip for the last mouseenter element ??? thbenda 0 211 4th October 09:24
Last Post: thbenda
  [Solved] Ajax element width trogo 1 584 27th September 12:37
Last Post: Craig
Information [Solved] Qtip assigned to an element, element is destroyed and created again, qtip doesnt work lovesniper 2 849 25th August 18:29
Last Post: Craig
  [Solved] Dynamic content based off map area befeetback 1 776 25th August 18:23
Last Post: Craig
Smile Persistent qtip which appears on hover disappears only by clicking on an element Bala 2 932 26th July 08:01
Last Post: Bala
  [Solved] How to destroy a qtip when the original element is removed molicule 2 1,351 12th April 16:19
Last Post: detj
  qtip pointing at the wrong element when scroll down div ramalaks 7 1,367 11th February 18:37
Last Post: Craig
  [Solved] Using 2 qtips on 1 element with different triggering events David 4 1,731 8th February 22:22
Last Post: ramalaks



User(s) browsing this thread: 1 Guest(s)