qTip2 :: Pre-release changes (AKA What happened to my qTip styles!?)

Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Viewport not working with absolute positioning.
28th February, 19:27
Post: #1
[Solved] Viewport not working with absolute positioning.
JS Code
initializeToolTip: function () {
        $(".offer-item").each(function () {
            $(this).hover().qtip({
                content: {
                    text: 'loading...',
                    title: {
                        button: true
                    },
                    ajax: {
                        url: '/Fakepath/ToolTips/ToolTipHover',
                        type: 'GET'
                    }
                },
 
                style: {
                    classes: { tooltip: 'auction-item-tooltip' }
                },
 
                show: {
                    solo: true
                },
 
                position: {                
                    viewport: $(window),
                    target: $(this),
                    my: 'top right',
                    at: 'top right',
                    adjust: {
                        method: 'flip flip',
                        x: 280,
                        y: -20
                    }
                },
 
                hide: 'unfocus'
 
            });
        });
 
    },
 
    initializeCloseToolTip: function () {
        $('a.close-tooltip').live("click", function (e) {
            e.preventDefault();
            $(this).parents('.qtip').qtip('hide');
        });
    }


Trying to get the last element to flip sides when outside of the window to no avail. Been looking at position.container and viewport to no avail. Anybody know if I'm doing something wrong? I have 5 <article>'s with tool tips next to each other, then on the last one I want the positioning to switch to 'top left' and opposite positioning.

Any help is much appreciated. Thanks for your time! Awesome plugin btw!

Here's some SS's of whats going on.

Regular: http://i.imgur.com/bI3oR.jpg

Cut-off http://i.imgur.com/wWhyq.jpg

Thanks again!
Visit this user's website Find all posts by this user
Quote this message in a reply
28th February, 22:46
Post: #2
RE: Viewport not working with absolute positioning.
Well first make sure you're using qTip2, since that's the forum you've posted in and the syntax you're using Wink If you ARE using qTip2, then the above should work as expected.

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
28th February, 22:49
Post: #3
RE: Viewport not working with absolute positioning.
I assure you I'm using QTip2 ;}

/*
* qTip2 - Pretty powerful tooltips
* http://craigsworks.com/projects/qtip2/

In jquery.qtip.min.js

It's still not working. does the viewport option work with using the absolute positioning option?

I have this cross posted on stackoverflow http://stackoverflow.com/questions/94892...ositioning

Thanks for the quick response Craig, lovely plugin.
Visit this user's website Find all posts by this user
Quote this message in a reply
28th February, 22:56
Post: #4
RE: Viewport not working with absolute positioning.
Oh sorry, I totally missed the absolute positioning part. Can you setup a test case on jsfiddle http://jsfiddle.net/fdavn

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
28th February, 23:19 (This post was last modified: 28th February 23:20 by thoughtpalette.)
Post: #5
RE: Viewport not working with absolute positioning.
(28th February 22:56)Craig Wrote:  Oh sorry, I totally missed the absolute positioning part. Can you setup a test case on jsfiddle http://jsfiddle.net/fdavn

Removed the ajax call and inner content (using Razor models) for clarity.

http://jsfiddle.net/fDavN/2761/

If you re-size the [Results] window to where all the divs line up, you can see on hover of the last one, that it doesn't re-position. :{

Let me know if there's anything else I can do to make this easier for you.

Thanks again Craig!
Visit this user's website Find all posts by this user
Quote this message in a reply
29th February, 01:06
Post: #6
RE: Viewport not working with absolute positioning.
Well the viewport positioning is working, it just seems like it isn't thanks to the adjust.x/y settings you've set! Remove those and you can see it working 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
29th February, 15:23
Post: #7
RE: Viewport not working with absolute positioning.
(29th February 01:06)Craig Wrote:  Well the viewport positioning is working, it just seems like it isn't thanks to the adjust.x/y settings you've set! Remove those and you can see it working Smile

I need it at that position per the design comps :{

It's alright, apparently my lead wrote some scripts when he used your plugin on another site where it calculates the window size and flips it based on left or right. We'll probably end up using that.

Good to know viewport and absolute position don't work in tandem though!

Thanks again Craig!
Visit this user's website Find all posts by this user
Quote this message in a reply
29th February, 17:56
Post: #8
RE: Viewport not working with absolute positioning.
That's not absolute positioning though... you're just adjusting the positioning calculated by qTip? If you basically want it at the top right of the div you can achieve as you've done using the position parameters

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
29th February, 17:59
Post: #9
RE: [Solved] Viewport not working with absolute positioning.
What are the x/y coordinates for if not setting an offset/hard position? The element in theory is "absolutely" positioned based on the coordinates provided through the plugin options.
Visit this user's website Find all posts by this user
Quote this message in a reply
29th February, 18:17
Post: #10
RE: [Solved] Viewport not working with absolute positioning.
They are to "adjust" the currently calculated position, hence why it's inside the position.adjust object Wink If you want to position it absolutely i.e. set it's left/top position manually, use the syntax below, as detailed in the documentation: http://craigsworks.com/projects/qtip2/do...on/#target
JS Code
position: {
	target: [100, 100] // [ left, top ]
}

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] Incorrect positioning tip of the first hover dm.rubtsov 2 125 18th May 15:10
Last Post: dm.rubtsov
  Hide not working in Chrome spamp 1 102 7th May 17:57
Last Post: Craig
  [Solved] position viewport with padding cpo 1 87 23rd April 18:34
Last Post: Craig
  [Solved] Working great in qtip1 fails with qTip2 SamLowry 1 108 20th April 15:47
Last Post: Craig
  [Solved] Dynamic positioning – move tooltip on resize Lancelotkiin 2 125 19th April 06:52
Last Post: Lancelotkiin
  Modal overlay does not span entire height of iPhone viewport cobhimself 1 111 16th April 21:56
Last Post: cobhimself
  [Solved] ajax.once = false, not working in IE9 but works in chrome jane26 5 147 9th April 12:52
Last Post: Craig
  [Solved] Not working with jQuery 1.9.1 garyw 2 380 8th April 11:58
Last Post: garyw
  [Solved] Button Event in qtip not working btjandra 4 175 5th April 19:38
Last Post: Craig
  qTips won't stay within bounds of viewport exces6 9 243 31st March 18:26
Last Post: exces6



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