Custom Button for Twitter Share
Posted by Mike
Twitter Share Popup using Custom Button Image
Finally, I have a Tweet Button that opens a popup window and uses a custom button image that works. A long time in the making, the project got put on the back-burner several times over the past six months.
Yesterday I finally got round to updating my website to use several of the code snippets I published last year, (never got round to changing these either until now) so it seemed the right time to get down and make this custom button twitter share popup work.
Twitter Popup
Part of the reason it took so long was having to use JavaScript – and I am not at all fond of java… I had the popup working in several versions, one only included the page URL, another just opened a popup tweet box with nothing in it. Neither of these were what I wanted. Thanks to Twitters fairly new “Intents” API, the popup now adds the page title and the URL – much better.
These functions have long been available using Twitters own tweet buttons, but if they don’t fit into the space allocated, then a custom image is a better solution, except for the hassle to get it to work properly.
Pop-up Tweet Button Working and Published
The working code is published on an HTML page on my website: Twitter Button Using Custom Image with Modal Window Popup (graphiclin.co.za). I used an HTML page as it fits into the rest of the series of code snippets, and is a bit easier to get the code to “copy and paste” without persuading Drupal to accept it without deleting the java…
The code snippet uses java and a graphic image, and as mentioned Twitters Intents API to open the pop-up. This is not a true Modal window, instead using the normal info-filled twitter pop-up that the default tweet button opens.
It works on HTML, Drupal and WordPress websites, and should work fine with Joomla or any other php system.
The code is free to share and use under the terms of Twitters Intents API and Developers API…
Posted on March 5, 2012, in Custom Share Buttons, Internet, Sharing, Snippets and tagged graphics, HTML, JavaScript, Social networks, Twitter, Website. Bookmark the permalink. Leave a Comment.
Leave a Comment
Comments (0)