Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extract title attr jigging stuff to function and call it before hover…

… suppress native browser tooltips in IE8
  • Loading branch information...
commit 88923af6ee0e18ac252dfc3034661674b7670a97 1 parent 5480fe7
@jaz303 authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/javascripts/jquery.tipsy.js
View
15 src/javascripts/jquery.tipsy.js
@@ -1,10 +1,17 @@
(function($) {
+ function fixTitle($ele) {
+ if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') {
+ $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title');
+ }
+ }
+
$.fn.tipsy = function(options) {
options = $.extend({}, $.fn.tipsy.defaults, options);
return this.each(function() {
+ fixTitle($(this));
var opts = $.fn.tipsy.elementOptions(this, options);
$(this).hover(function() {
@@ -17,11 +24,9 @@
tip.css({position: 'absolute', zIndex: 100000});
$.data(this, 'active.tipsy', tip);
}
-
- if ($(this).attr('title') || typeof($(this).attr('original-title')) != 'string') {
- $(this).attr('original-title', $(this).attr('title') || '').removeAttr('title');
- }
-
+
+ fixTitle($(this));
+
var title;
if (typeof opts.title == 'string') {
title = $(this).attr(opts.title == 'title' ? 'original-title' : opts.title);

0 comments on commit 88923af

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