mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Tooltips for media buttons. Hat tip: azaozz.
git-svn-id: https://develop.svn.wordpress.org/trunk@7311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -10,3 +10,36 @@ addLoadEvent( function() {
|
||||
jQuery('form').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
|
||||
}
|
||||
});
|
||||
|
||||
(function(JQ) {
|
||||
JQ.fn.tTips = function() {
|
||||
|
||||
JQ('body').append('<div id="tTips"><p id="tTips_inside"></p></div>');
|
||||
var TT = JQ('#tTips');
|
||||
|
||||
this.each(function() {
|
||||
var el = JQ(this), txt;
|
||||
|
||||
if ( txt = el.attr('title') ) el.attr('tip', txt).removeAttr('title');
|
||||
else return;
|
||||
el.find('img').removeAttr('alt');
|
||||
|
||||
el.mouseover(function(e) {
|
||||
txt = el.attr('tip'), o = el.offset();;
|
||||
|
||||
clearTimeout(TT.sD);
|
||||
TT.find('p').html(txt);
|
||||
|
||||
TT.css({'top': o.top - 43, 'left': o.left - 5});
|
||||
TT.sD = setTimeout(function(){TT.fadeIn(150);}, 100);
|
||||
});
|
||||
|
||||
el.mouseout(function() {
|
||||
clearTimeout(TT.sD);
|
||||
TT.css({display : 'none'});
|
||||
})
|
||||
});
|
||||
}
|
||||
}(jQuery));
|
||||
|
||||
jQuery(function(){jQuery('#media-buttons a').tTips();});
|
||||
|
||||
Reference in New Issue
Block a user