forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/// <reference path="../jquery/jquery.d.ts"/> | ||
/// <reference path="jquery.tipsy.d.ts"/> | ||
|
||
// basic | ||
$('#example-1').tipsy(); | ||
|
||
// code snippets from http://onehackoranother.com/projects/jquery/tipsy/ | ||
$('#foo').tipsy({gravity: 'n'}); // nw | n | ne | w | e | sw | s | se | ||
|
||
$('#foo').tipsy({gravity: $.fn.tipsy.autoNS}); | ||
|
||
$('#example-fade').tipsy({fade: true}); | ||
|
||
$('#example-custom-attribute').tipsy({title: 'id'}); | ||
|
||
$('#example-callback').tipsy({title: function() { return this.getAttribute('original-title').toUpperCase(); } }); | ||
|
||
$('#example-fallback').tipsy({fallback: "Where's my tooltip yo'?" }); | ||
|
||
$('#example-html').tipsy({html: true }); | ||
|
||
$('#example-delay').tipsy({delayIn: 500, delayOut: 1000}); | ||
|
||
$(function() { | ||
$('#focus-example [title]').tipsy({trigger: 'focus', gravity: 'w'}); | ||
}); | ||
|
||
function onclickExample1() { $("#manual-example a[rel=tipsy]").tipsy("show"); return false; } | ||
function onclickExample2() { $("#manual-example a[rel=tipsy]").tipsy("hide"); return false; } | ||
$('#manual-example a[rel=tipsy]').tipsy({trigger: 'manual'}); | ||
|
||
$('a.live-tipsy').tipsy({live: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Type definitions for jQuery.tipsy | ||
// Project: http://onehackoranother.com/projects/jquery/tipsy/ | ||
// https://github.com/jaz303/tipsy | ||
// Definitions by: Brian Dukes <https://github.com/bdukes/> | ||
// Definitions: https://github.com/borisyankov/DefinitelyTyped | ||
|
||
/// <reference path="../jquery/jquery.d.ts"/> | ||
|
||
interface JQuery { | ||
tipsy: JQueryTipsy.Tipsy; | ||
} | ||
|
||
|
||
declare module JQueryTipsy { | ||
interface Tipsy { | ||
(options?: Options): JQuery; | ||
autoNS: () => string; | ||
autoWE: () => string; | ||
autoSWSE: () => string; | ||
autoNWNE: () => string; | ||
} | ||
|
||
interface Options { | ||
delayIn?: number; | ||
delayOut?: number; | ||
fade?: boolean; | ||
fallback?: string; | ||
gravity?: any; // string or () => string | ||
html?: boolean; | ||
live?: boolean; | ||
offset?: number; | ||
opacity?: number; | ||
title?: any; // string or () => string | ||
trigger?: string; | ||
} | ||
} |