Sha256: ef54aacf35db36812f51843fb4cc727f9b5ac84a2e589d73257cabb6bb39e957

Contents?: true

Size: 1.65 KB

Versions: 47

Compression:

Stored size: 1.65 KB

Contents

/**
 * @license 
 * jQuery Tools @VERSION / Tooltip Slide Effect
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tooltip/slide.html
 *
 * Since: September 2009
 * Date: @DATE 
 */
(function($) { 

	// version number
	var t = $.tools.tooltip;
		
	// extend global configuragion with effect specific defaults
	$.extend(t.conf, { 
		direction: 'up', // down, left, right 
		bounce: false,
		slideOffset: 10,
		slideInSpeed: 200,
		slideOutSpeed: 200, 
		slideFade: !$.browser.msie
	});			
	
	// directions for slide effect
	var dirs = {
		up: ['-', 'top'],
		down: ['+', 'top'],
		left: ['-', 'left'],
		right: ['+', 'left']
	};
	
	/* default effect: "slide"  */
	t.addEffect("slide", 
		
		// show effect
		function(done) { 

			// variables
			var conf = this.getConf(), 
				 tip = this.getTip(),
				 params = conf.slideFade ? {opacity: conf.opacity} : {}, 
				 dir = dirs[conf.direction] || dirs.up;

			// direction			
			params[dir[1]] = dir[0] +'='+ conf.slideOffset;
			
			// perform animation
			if (conf.slideFade) { tip.css({opacity:0}); }
			tip.show().animate(params, conf.slideInSpeed, done); 
		}, 
		
		// hide effect
		function(done) {
			
			// variables
			var conf = this.getConf(), 
				 offset = conf.slideOffset,
				 params = conf.slideFade ? {opacity: 0} : {}, 
				 dir = dirs[conf.direction] || dirs.up;
			
			// direction
			var sign = "" + dir[0];
			if (conf.bounce) { sign = sign == '+' ? '-' : '+'; }			
			params[dir[1]] = sign +'='+ offset;			
			
			// perform animation
			this.getTip().animate(params, conf.slideOutSpeed, function()  {
				$(this).hide();
				done.call();		
			});
		}
	);  
	
})(jQuery);	
		

Version data entries

47 entries across 47 versions & 3 rubygems

Version Path
spiderfw-1.0.1 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-1.0.0 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.39 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.38 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.37 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.35 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.34 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.33 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.32 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.31 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.30 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.29 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.28 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
jqtools-rails-0.1.3 vendor/assets/javascripts/tooltip/tooltip.slide.js
jqtools-rails-0.1.2 vendor/assets/javascripts/tooltip/tooltip.slide.js
spiderfw-0.6.27 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.26 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
spiderfw-0.6.26.pre1 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js
jqtools-rails-0.1.1 vendor/assets/javascripts/tooltip/tooltip.slide.js
spiderfw-0.6.25 apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js