kevin-cantwell / webmailto Goto Github PK
View Code? Open in Web Editor NEWOpen mailto links in Gmail, Yahoo, or Hotmail.
Home Page: http://kevin-cantwell.github.com/webmailto/
Open mailto links in Gmail, Yahoo, or Hotmail.
Home Page: http://kevin-cantwell.github.com/webmailto/
Webmail Mailto jQuery Plugin http://kevin-cantwell.github.com/webmailto/ Copyright (c) 2010 Kevin Cantwell License: Meh. Just don't sell it, ok? *** WTH is it? *** When the user hovers over a mailto link, they are given the option to compose an email in one of three popular webmail services, Gmail, Yahoo, or Hotmail, instead of in their default mail client. *** Dependencies *** 1) jQuery 1.4 2) Availability of direct links to compose windows in Gmail, Yahoo, and Hotmail. *** Known Bugs *** 1) Sometimes the webmail compose window doesn't completely load. This happens most often with Yahoo. I don't think I have much control over this, so it's unlikely to be addressed. 2) Hotmail bcc does not work. No idea why. *** How to Use the Webmailto Plugin *** First make sure to include jQuery and the plugin inside your <head/> tag: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://github.com/kevin-cantwell/webmailto/raw/master/jquery.webmailto.js" type="text/javascript"></script> Then you can call webmailto on link tags in the normal jQuery way: <script type="text/javascript"> $(document).ready(function() { $('a').webmailto(); }); </script> Hovering over any matched elements will cause an absolutely positioned list of webmail links to appear underneath. If the selector matches a link tag which is not a mailto link, or if the tag is not a <a/> tag, then it is silently ignored. In the above case, all mailto links on the page would be matched. *** "Features" *** Webmailto does not apply any default styling. However, you can define your own styles by implementing the webmailto class or by passing css into the plugin as optional parameters. Implementing the webmailto class: <style type="text/css"> ul.webmailto { list-style : none; margin : 0; padding : 0; background-image : url('img/webmails.png'); } ul.webmailto li { display : inline; } ul.webmailto li a { margin : 0; display : inline-block; text-indent : -9999px; width : 50px; height : 50px; } </style> Passing in your own css class to the plugin to achieve multiple stylings: <script type="text/javascript"> $(document).ready(function() { $('a.default').webmailto(); $('a.meh').webmailto( { className : 'mediocre-css' } ); $('a.exciting').webmailto( { className : 'awesome-css' } ); }); </script> *** Handle to New Window *** Webmailto can provide you a handle to the newly opened window via a callback function: <script type="text/javascript"> $('a').webmailto( { className : 'custom', callback : function(newWindow) { // This may not work well in IE, sorry... newWindow.confirm('Destroy the warp core?'); } } ); </script>
So far, only Gmail functions correctly. Need to update the urls for yahoo and hotmail to get those working.
Only mouseleave triggers the context menu to detach. Perhaps leverage Hover Intent for a more intuitive experience?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.