I change the text for tweet button but when I change attributes is generating a blink effect


Here is the code to see the blink effect

Thank you very much and sorry if is a newbie thing but I didn’t find anything in internet.


The flicker is caused by removing and initializing a new widget. The DOM is redrawing between the embed code being embedded and the iframe being initialized.

Although the redraw is inevitable for now, you could probably improve it by using the direct creation fuction, like so:

{ text: $(’#tweetText’).val() }

It’s still drawing a new element on the page, so some browsers might still flicker, depending on their redraw implementation.

Another way to handle this is to not use the Tweet Button widget, and instead reference the Web Intent URL directly from your button or a link, which will allow you to update the text attribute without redrawing.