349
Views
3
Comments
[jQuery Tooltip] Problem with ajax refresh
Question
con-logo-gif
Web icon
Forge asset by Justin James
Justin,

I had a problem in my app when I had multiple tooltips that are loaded in webblocks and I already had some elements with tooltip on my screen. When I refresh my containar to show a webblock with the tooltips, the others tooltips gets broken. It shows the first time that i put my mouse over it, but it doesn't show anymore. 

To fix this i put this code before you bind the events on javascript:

targets.unbind();

This way all the binds on the element are removed and then the component can bind the events to all elements again.

I hope this helps someone else.

?
Cheers
Victor
2019-11-12 17-31-26
Justin James
 
MVP
Good to know, thanks!

J.Ja
UserImage.jpg
Cory Creamer

Victor Salvalagio Pereira wrote:

Justin,

I had a problem in my app when I had multiple tooltips that are loaded in webblocks and I already had some elements with tooltip on my screen. When I refresh my containar to show a webblock with the tooltips, the others tooltips gets broken. It shows the first time that i put my mouse over it, but it doesn't show anymore.

To fix this i put this code before you bind the events on javascript:

targets.unbind();

This way all the binds on the element are removed and then the component can bind the events to all elements again.

I hope this helps someone else.

?
Cheers
Victor

Not a javascript guy here - how exactly do I make this change?

Thanks

Cory


2023-05-03 10-22-17
Victor Salvalagio Pereira

Cory Creamer wrote:

Victor Salvalagio Pereira wrote:

Justin,

I had a problem in my app when I had multiple tooltips that are loaded in webblocks and I already had some elements with tooltip on my screen. When I refresh my containar to show a webblock with the tooltips, the others tooltips gets broken. It shows the first time that i put my mouse over it, but it doesn't show anymore.

To fix this i put this code before you bind the events on javascript:

targets.unbind();

This way all the binds on the element are removed and then the component can bind the events to all elements again.

I hope this helps someone else.

?
Cheers
Victor

Not a javascript guy here - how exactly do I make this change?

Thanks

Cory



Hi Cory.


You have to put this code

targets.unbind();

before this line

targets.bind( 'mouseenter', function()

in the expression inside the Tooltip webblock.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.