Twitter button not showing if initially hidden

I have a twitter button on the page using a widget. The button is displayed as if I were not putting it in a hidden container.

I would like to put the sharing button in a hidden container that only appears when clicked. I have all the functionality, however, the Twitter button will not be displayed if it is placed in a hidden container.

+4
source share
2 answers

You can use the CSS tag display: noneand then remove the tag when you click the button and add the tag back when you finish sharing on Twitter.

Something like that:

HTML

<input type="button" class="clickMe" value="Click Me" />
<img src="img/twitter.png" class="twitterPic hideMe" />

CSS

, .

.hideMe { display: none;}

JavaScript

$(".clickMe").on("click", function () {
    $(".twitterPic").removeClass("hideMe");
});

JQuery :

https://api.jquery.com/removeClass/

https://api.jquery.com/addClass/

0

:

  • , sth, 5000px .container {left:5000px;}
  • display:none css , . , twitter .
  • , offset(), . , .
0

All Articles