SourceCode/jiouosdp/Scripts/jquery.validate/Tooltip/jquery.poshytip.js
(开头部分) 18KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
* Poshy Tip jQuery plugin v1.2
* http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
* Copyright 2010-2013, Vasil Dinkov, http://vadikom.com/
*/
(function($) {
var tips = [],
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
rePNG = /\.png$/i,
ie6 = !!window.createPopup && document.documentElement.currentStyle.minWidth == 'undefined';
// make sure the tips' position is updated on resize
function handleWindowResize() {
$.each(tips, function() {
this.refresh(true);
});
}
$(window).resize(handleWindowResize);
$.Poshytip = function(elm, options) {
this.$elm = $(elm);
this.opts = $.extend({}, $.fn.poshytip.defaults, options);
this.$tip = $(['<div class="',this.opts.className,'">',
'<div class="tip-inner tip-bg-image"></div>',
'<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',
'</div>'].join('')).appendTo(document.body);
this.$arrow = this.$tip.find('div.tip-arrow');
this.$inner = this.$tip.find('div.tip-inner');
this.disabled = false;
this.content = null;
this.init();
};
$.Poshytip.prototype = {
init: function() {
tips.push(this);
// save the original title and a reference to the Poshytip object
var title = this.$elm.attr('title');
this.$elm.data('title.poshytip', title !== undefined ? title : null)
.data('poshytip', this);
// hook element events
if (this.opts.showOn != 'none') {
this.$elm.bind({
'mouseenter.poshytip': $.proxy(this.mouseenter, this),
'mouseleave.poshytip': $.proxy(this.mouseleave, this)
});
switch (this.opts.showOn) {
case 'hover':
if (this.opts.alignTo == 'cursor')
this.$elm.bind('mousemove.poshytip', $.proxy(this.mousemove, this));
if (this.opts.allowTipHover)
this.$tip.hover($.proxy(this.clearTimeouts, this), $.proxy(this.mouseleave, this));
break;
case 'focus':
this.$elm.bind({
'focus.poshytip': $.proxy(this.showDelayed, this),
后面还有 445 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。