Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] qTips in wrong position when a div is scrolled
12th January, 10:08
Post: #1
[Solved] qTips in wrong position when a div is scrolled
I've run into a little problem. I've got a fixed height div with a scrollbar that contains rows of items. Each item has a tooltip that pops up next to it. When you scroll down the div to the lower items and show the tooltip, the tip is shown below the div as if the div wasn't at a fixed height. A simple version is shown in this jsFiddle. http://jsfiddle.net/bmnAD/3/

I'm at a loss. Any ideas?
Find all posts by this user
Quote this message in a reply
12th January, 19:06
Post: #2
RE: qTips in wrong position when a div is scrolled
I'm also curious how to accomplish what you're after. I would think you could somehow re-calculate the position before the tip is shown rather than use the cached value. I'm not quite sure how or if it's possible though.
Find all posts by this user
Quote this message in a reply
12th January, 19:56
Post: #3
RE: qTips in wrong position when a div is scrolled
I've got the same problem when having qtips in a jquery dialog that has a set height and content scrolls!
Find all posts by this user
Quote this message in a reply
12th January, 21:56
Post: #4
RE: qTips in wrong position when a div is scrolled
Try out the latest commit guys, hopefully that should solve your issues! http://jsfiddle.net/bmnAD/9/

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
12th January, 22:09
Post: #5
RE: qTips in wrong position when a div is scrolled
(12th January 21:56)Craig Wrote:  Try out the latest commit guys, hopefully that should solve your issues! http://jsfiddle.net/bmnAD/9/

Excellent! Thanks Craig. You're amazing!
Find all posts by this user
Quote this message in a reply
12th January, 22:34
Post: #6
RE: [Solved] qTips in wrong position when a div is scrolled
Check this example out Craig:

http://jsfiddle.net/ry8CZ/2/

It doesn't seem to work with horizontal scrolling. Any ideas?
Find all posts by this user
Quote this message in a reply
12th January, 22:48
Post: #7
RE: [Solved] qTips in wrong position when a div is scrolled
(12th January 22:34)aar0n Wrote:  Check this example out Craig:

http://jsfiddle.net/ry8CZ/2/

It doesn't seem to work with horizontal scrolling. Any ideas?

Make sure to set the position.container option. http://jsfiddle.net/ry8CZ/3/
Find all posts by this user
Quote this message in a reply
12th January, 22:55
Post: #8
RE: [Solved] qTips in wrong position when a div is scrolled
You need to have it contained inside the scrolling container Aaron Smile

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
12th January, 23:05
Post: #9
RE: [Solved] qTips in wrong position when a div is scrolled
Ah I see... very cool!
Find all posts by this user
Quote this message in a reply
13th January, 14:25
Post: #10
RE: [Solved] qTips in wrong position when a div is scrolled
Not so fast!!! Tongue

if it's in a jquery ui dialog, it still positions them all wonky.

http://jsfiddle.net/bmnAD/19/
Find all posts by this user
Quote this message in a reply
14th January, 15:20
Post: #11
RE: [Solved] qTips in wrong position when a div is scrolled
I found another problem ...

In some cases, the screen is blinking when QTIP prepare his render (or prepare content in ajax case) ...

This issue is only when the QTIP is on an element not initially visible in the scroll container.
For example, in a table with 10 rows but only 3 rows initialy visible in the canevas ... The problem appears only into rows from 4 to 10 !
=> When i scroll verticaly and then i ask QTIP to show ...

But in my case and with my framework, i can't reproduce problem with JSFIDDLE ...

My config :
- A table with Vertical scrolling and big rows (50px for each row height)
- An ajax request to retrieve content ...
- A "delegate" listener

My QTIP code :
JS Code
var parentId = 'div#HelpdeskView_0.dataGrid1'.replace(/\./g, '\\.');
$(parentId).delegate('div.gridCellToolTip', 'mouseover', function (event) {
    var targetId = 'containerId';
    var elementId = $(this).attr('id');
    var ajaxURL = 'http://myajaxurl';
    $(this).qtip({
        overwrite: false,
        content: {
            text: 'Loading ...',
            ajax: {
                url: ajaxURL,
                type: 'POST',
                once: false,
                success: function (data, status) {
                    updateTooltipAjax(this, data, status);
                }
            }
        },
        show: {
            ready: true,
            delay: 750,
            solo: true
        },
        hide: {
            fixed: true,
            delay: 180
        },
        position: {
            container: $(targetId),
            my: 'bottom center',
            at: 'top center',
        },
        style: {
            classes: 'ui-tooltip-shadow ui-tooltip-rounded ui-tooltip-plain'
        }
    });
});


I'm trying to reproduce exactly with JsFiddle ...

Thanks by advance for your help !!!
Find all posts by this user
Quote this message in a reply
16th January, 00:22 (This post was last modified: 16th January 00:28 by todsa.)
Post: #12
RE: [Solved] qTips in wrong position when a div is scrolled
Quote:Posted by patricia - 13th January 14:25
Not so fast!!! Tongue

if it's in a jquery ui dialog, it still positions them all wonky.

http://jsfiddle.net/bmnAD/19/

I'm having this same problem with my site as i also use the jQuery UI. I have tabs and the positions get all wonky when you scroll. I've downloaded the latest code and the problem is still the same.

I should add... this was a problem in IE6, not Firefox.

Any help Big Grin?
Find all posts by this user
Quote this message in a reply
17th January, 14:29
Post: #13
RE: [Solved] qTips in wrong position when a div is scrolled
For me it happens in FF and IE
Find all posts by this user
Quote this message in a reply
18th January, 17:32
Post: #14
RE: [Solved] qTips in wrong position when a div is scrolled
Working on this now the tips plugin has been updated. Bare with me guys Smile

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 January, 11:12
Post: #15
RE: [Solved] qTips in wrong position when a div is scrolled
Thanks Craig. I've posted way too many threads here recently, but thanks for the help. I love what you've made, and I think it's the best tooltip plugin for jQuery.
Find all posts by this user
Quote this message in a reply
19th January, 20:11 (This post was last modified: 19th January 20:34 by sparky672.)
Post: #16
RE: [Solved] qTips in wrong position when a div is scrolled
I'm not sure if my problem is the same as described here... so I'm not sure if I did something wrong or if I'm supposed to be waiting on the next update.

I have one of those floating toolbar things. It's always x number of pixels from the top of the window no matter where you scroll the window content. qTip works great when the page is at the top... HOWEVER once you scroll downward, the qTips just move along up with the content. But the toolbar is fixed (floating over the scrolling content) as it should be and the tips no longer line up with their respective elements.

Somebody said to put "it" in the same div as the toolbar but that doesn't make any sense to me. The elements triggering the tips are already in the toolbar since they are the toolbar images themselves. And the rest is just JavaScript and CSS so of course that doesn't need to be inside the div.

So before I create a demo in JSFiddle, is this the same bug Craig is currently attempting to fix?
(18th January 17:32)Craig Wrote:  ... Bare with me guys Smile

yikes! keep your webcam off then! Tongue
Find all posts by this user
Quote this message in a reply
20th January, 14:37
Post: #17
RE: [Solved] qTips in wrong position when a div is scrolled
Heh Tongue sparky, set your position.container option to the fixed div and it should fix your problem.

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
20th January, 15:24 (This post was last modified: 20th January 15:37 by sparky672.)
Post: #18
RE: [Solved] qTips in wrong position when a div is scrolled
(20th January 14:37)Craig Wrote:  Heh Tongue sparky, set your position.container option to the fixed div and it should fix your problem.

JS Code
container: $('#myFloatingToolBar'),


That made it worse... a lot worse.

1. I can only see the tip of the pointer and it's not pointing at the correct element. Only seeing the tip because I have overflow set to hidden on my fixed div toolbar. I cannot explain why it's pointing at the wrong thing. Scrolling changes the position of the tip.

2. If I remove the overflow:hidden from my fixed div, then I can see the whole qTip. But again, it's pointing at the wrong element, scrolling makes it worse, and for some very odd reason the qTip is squished down to about 75 pixels wide (tip is wrapping) despite the fact that it should not wrap (tooltip is only a few words).

Without setting the position container, it looks fine until the page is scrolled.
Find all posts by this user
Quote this message in a reply
20th January, 16:24
Post: #19
RE: [Solved] qTips in wrong position when a div is scrolled
I've added a fix for this in the latest commit, check it out sparky Smile

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
20th January, 16:44 (This post was last modified: 20th January 16:44 by sparky672.)
Post: #20
RE: [Solved] qTips in wrong position when a div is scrolled
(20th January 16:24)Craig Wrote:  I've added a fix for this in the latest commit, check it out sparky Smile

Updated with latest qTip JS and CSS... No dice.

The scrolling part seems to be fixed but...

1. qTip box still squished for some unknown reason.

2. qTip is always offset by the same amount as my ToolBar. ie... my toolbar Div is fixed positioned 90 pixels from the top edge of the window so the qTip is positioned 90 pixels under the element I'm pointing to (90 pixels from the top edge of the floating toolbar.)
Find all posts by this user
Quote this message in a reply
20th January, 16:53
Post: #21
RE: [Solved] qTips in wrong position when a div is scrolled
Can you setup a test case on jsfiddle please?

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
20th January, 17:10 (This post was last modified: 20th January 17:39 by sparky672.)
Post: #22
RE: [Solved] qTips in wrong position when a div is scrolled
(20th January 16:53)Craig Wrote:  Can you setup a test case on jsfiddle please?

I will try. It may take me a while.
Just so you know... everything I've described about this problem, to this point, is happening in Safari...

This jsfiddle show the problem exactly, but only happening in Safari...

http://jsfiddle.net/SGAh8/

It actually works in Firefox but totally breaks down in Explorer.
Find all posts by this user
Quote this message in a reply
20th January, 23:24
Post: #23
RE: [Solved] qTips in wrong position when a div is scrolled
Not sure if you got notification of my last reply so I'm bumping. See above.
Find all posts by this user
Quote this message in a reply
21st January, 20:24
Post: #24
RE: [Solved] qTips in wrong position when a div is scrolled
JSFiddle posted yesterday... did you see it?
Find all posts by this user
Quote this message in a reply
24th January, 19:16
Post: #25
RE: [Solved] qTips in wrong position when a div is scrolled
Working on this in a few days guys, exams at the moment so don't have much time to spend. Bear with me Wink

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
  Multiple qtips one target... using an each() statement wtgmatt 1 22 20th May 21:17
Last Post: Craig
  Modal Qtip from hidden div gets out of sync macsupport 1 763 12th April 15:35
Last Post: Craig
  [Solved] Tooltip breaks after moving cursor from one div to another linxgws 1 210 9th April 15:32
Last Post: Craig
  [Solved] clear qtips when rebuilding DOM dfrankson 4 191 4th April 14:24
Last Post: dfrankson
  [Solved] How can I manually show qtips when needed? yougotnet 3 224 28th March 15:40
Last Post: Craig
  [Solved] JS created qtips, only "last" qtip generated displays ZacWolf 2 225 26th March 14:11
Last Post: ZacWolf
  [Solved] Tooltip displaying in the wrong place jbramford 2 244 13th March 16:30
Last Post: jbramford
  [Solved] Mouseout to specified div, keep qtip open Maverick 7 760 29th February 16:43
Last Post: Maverick
  [Solved] Adding a handler to something in qtips title ewalsh 3 333 26th February 12:06
Last Post: ewalsh
  [Solved] qtips are visible only once fourgood 2 388 17th February 14:29
Last Post: fourgood



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