Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Troubles with show/hide
10th November, 13:55
Post: #1
Troubles with show/hide
I've got a site where there are qtip hovers on various items, but also a search box with auto-complete, which I want to trigger qtips with. The intention is that users can hover over the items (of which there are a lot) or search for the item and upon choosing the item from the auto-complete dropdown, the qtip for that item appears on the page in its expected place.

I'm using the following to initialise the qtips
JS Code
jQuery(mySelector).each(function(){
        jQuery(this).qtip({
         content:'test',
         show: 'mouseover',
         hide: 'mouseout',
         position: {
            corner: {
               target: 'centre',
               tooltip: 'leftBottom'
            }
         },
         show: { effect:{length:0} },
         hide: { effect:{length:0}}
      })
});


and in the callback for the auto-complete (yes, its definitely working) I have
JS Code
var thisapi = jQuery(mySelector).qtip("api").show();


The problem is that this only seems to work for qtips which i have previously mouse-overed, since the page load. If i refresh the page and immediately try the auto-complete, it fails. If i refresh the page, hover any qtip manually, then choose the corresponding auto-complete item, it works (it still doesn't work for items i haven't previously hovered over manually)

Any help appreciated
Find all posts by this user
Quote this message in a reply
12th November, 16:53 (This post was last modified: 13th November 09:18 by mcorkum.)
Post: #2
Troubles with show/hide
I want to show a tooltip by calling show() from window.setTimeout(). This is not working. The qTip appears on Mouse Over but not by the timer event.

I did not realize the timer event is working after hovering the button for a very short time, which has the qtip attached, until you mentioned it here. So it seems to be a similar problem.

I even tried an .qtip("enable"); before calling .show(), but it is still not working.

Cheers
Tsunamis
Find all posts by this user
Quote this message in a reply
13th November, 14:15
Post: #3
Troubles with show/hide
Maybe it was a problem that i used the tooltip inside a modal jQuery dialog.

My solution is as follows:

I initialize the tooltip in the modal dialog open callback. Before i initialized all tooltips after the page was loaded. Now i skip the tooltip in the modal dialog and use the callback. Now it works as expected. I additonally added the hide method into the modal close callback.

Cheers
Tsunamis
Find all posts by this user
Quote this message in a reply
Post Reply 




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