1
0

scripts.js 681 B

123456789101112131415
  1. // Empty JS for your own code to be here
  2. $(document).ready(function() {
  3. $('a.tweet').click(function(e){
  4. e.preventDefault();
  5. //We get the URL of the link
  6. var loc = $(this).attr('href');
  7. //We get the title of the link
  8. var title = encodeURIComponent($(this).attr('title'));
  9. var title = escape($(this).attr('title'));
  10. //We trigger a new window with the Twitter dialog, in the middle of the page
  11. window.open('http://twitter.com/share?url=' + loc + '&text=' + title + '&', 'twitterwindow', 'height=450, width=550, top='+($(window).height()/2 - 225) +', left='+$(window).width()/2 +', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
  12. });
  13. });