CommonBussiness/js/jquery.poshytip.js

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * Poshy Tip jQuery plugin v1.0
 * http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
 * Copyright 2010, Vasil Dinkov, http://vadikom.com/
 */

(function($) {

	var tips = [],
		reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
		rePNG = /\.png$/i,
		ie6 = $.browser.msie && $.browser.version == 6;

	// 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(''));
		this.$arrow = this.$tip.find('div.tip-arrow');
		this.$inner = this.$tip.find('div.tip-inner');
		this.disabled = false;
		this.init();
	};

	$.Poshytip.prototype = {
		init: function() {
			tips.push(this);

			// save the original title and a reference to the Poshytip object
			this.$elm.data('title.poshytip', this.$elm.attr('title'))
				.data('poshytip', this);

			// hook element events
			switch (this.opts.showOn) {
				case 'hover':
					this.$elm.bind({
						'mouseenter.poshytip': $.proxy(this.mouseenter, this),
						'mouseleave.poshytip': $.proxy(this.mouseleave, this)
					});
					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.hide, this));
					break;
				case 'focus':
					this.$elm.bind({
						'focus.poshytip': $.proxy(this.show, this),
						'blur.poshytip': $.proxy(this.hide, this)
					});
					break;
后面还有 354 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。