Skip to content
Browse files

Extract defaults

  • Loading branch information...
1 parent 7d0788b commit ff136e0fb6eafe5efa98dd18b539dfe2e173fa3d @jaz303 jaz303 committed Jan 1, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/javascripts/jquery.tipsy.js
View
12 src/javascripts/jquery.tipsy.js
@@ -1,7 +1,7 @@
(function($) {
$.fn.tipsy = function(opts) {
- opts = $.extend({fade: false, gravity: 'n', title: 'title', fallback: '', html: false}, opts || {});
+ opts = $.extend({}, $.fn.tipsy.defaults, opts);
var tip = null;
this.hover(function() {
@@ -69,9 +69,19 @@
}, 100);
});
+
+ return this;
};
+ $.fn.tipsy.defaults = {
+ fade: false,
+ fallback: '',
+ gravity: 'n',
+ html: false,
+ title: 'title'
+ };
+
$.fn.tipsy.autoNS = function() {
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
};

0 comments on commit ff136e0

Please sign in to comment.
Something went wrong with that request. Please try again.