[jQuery Tooltip] Problem with ajax refresh

[jQuery Tooltip] Problem with ajax refresh

  
Forge Component
(2)
Published on 2013-04-08 by Justin James
2 votes
Published on 2013-04-08 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
Good to know, thanks!

J.Ja

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


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.