开发者

qtip jquery, Ghosts" Artefacts of Tooltip in DOM, how remove

开发者 https://www.devze.com 2023-01-10 06:04 出处:网络
I am using the qtip plugin in the jquery fullcalendar (on doubleclick on a event). I create a modal tooltip window in my page. In this tooltip window i am loading some ajax content and calling some

I am using the qtip plugin in the jquery fullcalendar (on doubleclick on a event).

I create a modal tooltip window in my page. In this tooltip window i am loading some ajax content and calling some functions (links with binded events, example deleting the event on the calendar), but this is not the problem i think.

If i open the tooltip at the firsttime everything is ok. on the second and more openings my jQuery-selector (selection by id) is fired two or more times.

I checked the generated code with Webdeveloper-Toolbar of FireFox. I saw all created tooltips in the DOM (every doubleclick creates a tooltip in the DOM, so i have a lot of copies in it). After closing the tooltip (standard function of tooltip), the tooltips are always present in the DOM (every opening of an tooltip creates an "ghost", not visible, but my jquery selector find it).

I read some similar problems but i don't understand the solution.

how can i remove this "ghosts", because the "ghosts" need memory a produce undefined results (more than one element with the same id, for example).

i try for example: $('.qtip').remove(); and other solutions like this with $(this).parents... etc. no result.

Or i call the remove on the开发者_运维问答 wrong places. First Try: remove it on the hideEvent of qTip Second Try: on doubleclick on an event of my calendar. --> No effect in both.

Thanks so much for an solution.

Chichi

Thanks alot for reply.


qTip is great, no need to remove it, face the problem!

I had the same issue with qTip. What qTip version are you using? Switch to qTip2! It fixes this problem for you.

Like jhanifen says in his comment, I used

$('a.ppname[rel]').qtip({
   content : {stuff},
   style : {stuff},
   position: {stuff},
   show: 'mouseover',
   hide: 'mouseout',
   onHide: function() { $(this).qtip('destroy'); }
});

to remove the qTip from DOM. qTip2 handles this for you. Here is my example for qTip2 usage.

More examples: qTip2 Demos.

0

精彩评论

暂无评论...
验证码 换一张
取 消