Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Style Twitter popup

I added a Twitter share button into my blog using the below code:

<a class="twitter popup" href="http://twitter.com/share?text=mytext">Tweet Me</a>

and I open it in a popup with:

    <script type="text/javascript">
 $('.popup').click(function(event) {
    var width  = 575,
        height = 400,
        left   = ($(window).width()  - width)  / 2,
        top    = ($(window).height() - height) / 2,
        url    = this.href,
        opts   = 'status=1' +
                 ',width='  + width  +
                 ',height=' + height +
                 ',top='    + top    +
                 ',left='   + left;

    window.open(url, 'twitte', opts);

    return false;
  });</script>

There is a way to style the popup? I want my styled popup with the twitter form in it.

like image 529
Andref Avatar asked Jun 14 '11 11:06

Andref


People also ask

Does Twitter have pop ups?

Twitter Support on Twitter: "Enable pop-up notifications for the web so you can quickly reply to Tweets or Messages: https://t.co/8UlD54uZaH" / Twitter.

How do I get rid of the twitter login pop up?

There are two simple ways to bypass the login barrier. The easiest way to bypass the login wall is to prevent Twitter from setting cookies in your browser, usually found in the privacy options in whatever browser you use. At the moment, viewing Twitter in incognito mode in your browser works too.

How do I get rid of Don't miss what's happening on Twitter?

To do so, follow the steps below. Select your profile picture. From the menu that opens, tap or click “Topics.” You'll see the list of topics you're following, so find the one you want to remove and select “Unfollow.”

How do you get the follow button on twitter?

Go to https://publish.twitter.com/. Customize the follow button to your liking with the available options. Copy and paste the code into the HTML of your website wherever you would like the button to appear. (At this time, the follow button cannot be added to Facebook profiles.)


2 Answers

If you want complete control over the look and feel, then Twitter's @anywhere Tweet Box is what you would need to implement. Well, either that or get a Twitter client library and roll your own approach.

Using @anywhere will require you to set up an application on dev.twitter.com, and your users will need to authorize your app to post a tweet, but that's the price you pay for flexibility.

Twitter Web Intents could be an alternative for you, but the layout displayed in your popup would be Twitter's, not yours. It is, however, worth mentioning since you don't have the application registration requirement.

Web Intents provide popup-optimized flows for working with Tweets & Twitter Users: Tweet, Reply, Retweet, Favorite, and Follow. They make it possible for users to interact with Twitter content in the context of your site, without leaving the page or having to authorize a new app just for the interaction.

like image 152
arcain Avatar answered Oct 12 '22 23:10

arcain


If you're just opening page content in a standard browser window/tab, you don't have much control over how that looks. You can get more control and styling options if you pop it up in the same browser window, but perhaps in a lightbox fashion. Here are some lightboxy jQuery plugins that you may want to check out:

http://line25.com/articles/rounding-up-the-top-10-jquery-lightbox-scripts

like image 34
Kon Avatar answered Oct 12 '22 23:10

Kon