PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.5.2
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.5.2
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / assets / js / jquery-tiptip / jquery.tipTip.js
everest-forms / assets / js / jquery-tiptip Last commit date
jquery.tipTip.js 3 years ago jquery.tipTip.min.js 3 years ago
jquery.tipTip.js
193 lines
1 /*
2 * TipTip
3 * Copyright 2010 Drew Wilson
4 * www.drewwilson.com
5 * code.drewwilson.com/entry/tiptip-jquery-plugin
6 *
7 * Version 1.3 - Updated: Mar. 23, 2010
8 *
9 * This Plug-In will create a custom tooltip to replace the default
10 * browser tooltip. It is extremely lightweight and very smart in
11 * that it detects the edges of the browser window and will make sure
12 * the tooltip stays within the current window size. As a result the
13 * tooltip will adjust itself to be displayed above, below, to the left
14 * or to the right depending on what is necessary to stay within the
15 * browser window. It is completely customizable as well via CSS.
16 *
17 * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
18 * http://www.opensource.org/licenses/mit-license.php
19 * http://www.gnu.org/licenses/gpl.html
20 */
21
22 (function($){
23 $.fn.tipTip = function(options) {
24 var defaults = {
25 activation: "hover",
26 keepAlive: false,
27 maxWidth: "200px",
28 edgeOffset: 3,
29 defaultPosition: "bottom",
30 delay: 400,
31 fadeIn: 200,
32 fadeOut: 200,
33 attribute: "title",
34 content: false, // HTML or String to fill TipTIp with
35 enter: function(){},
36 exit: function(){}
37 };
38 var opts = $.extend(defaults, options);
39
40 // Setup tip tip elements and render them to the DOM
41 if($("#tiptip_holder").length <= 0){
42 var tiptip_holder = $('<div id="tiptip_holder" style="max-width:'+ opts.maxWidth +';"></div>');
43 var tiptip_content = $('<div id="tiptip_content"></div>');
44 var tiptip_arrow = $('<div id="tiptip_arrow"></div>');
45 $("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));
46 } else {
47 var tiptip_holder = $("#tiptip_holder");
48 var tiptip_content = $("#tiptip_content");
49 var tiptip_arrow = $("#tiptip_arrow");
50 }
51
52 return this.each(function(){
53 var org_elem = $(this);
54 if(opts.content){
55 var org_title = opts.content;
56 } else {
57 var org_title = org_elem.attr(opts.attribute);
58 }
59 if(org_title != ""){
60 if(!opts.content){
61 org_elem.removeAttr(opts.attribute); //remove original Attribute
62 }
63 var timeout = false;
64
65 if(opts.activation == "hover"){
66 org_elem.on( 'mouseenter', function(){
67 active_tiptip();
68 } ).on( 'mouseleave', function(){
69 if(!opts.keepAlive || !tiptip_holder.is(':hover')){
70 deactive_tiptip();
71 }
72 });
73 if(opts.keepAlive){
74 tiptip_holder.on( 'mouseenter', function(){} ).on( 'mouseleave', function(){
75 deactive_tiptip();
76 });
77 }
78 } else if(opts.activation == "focus"){
79 org_elem.on( 'focus', function(){
80 active_tiptip();
81 }).on( 'blur', function(){
82 deactive_tiptip();
83 });
84 } else if(opts.activation == "click"){
85 org_elem.on( 'click', function(){
86 active_tiptip();
87 return false;
88 }).on( 'mouseenter', function(){} ).on( 'mouseleave' ,function(){
89 if(!opts.keepAlive){
90 deactive_tiptip();
91 }
92 });
93 if(opts.keepAlive){
94 tiptip_holder.on( 'mouseenter', function(){} ).on( 'mouseleave', function(){
95 deactive_tiptip();
96 });
97 }
98 }
99
100 function active_tiptip(){
101 opts.enter.call(this);
102 tiptip_content.html(org_title);
103 tiptip_holder.hide().css("margin","0");
104 tiptip_holder.removeAttr('class');
105 tiptip_arrow.removeAttr("style");
106
107 var top = parseInt(org_elem.offset()['top']);
108 var left = parseInt(org_elem.offset()['left']);
109 var org_width = parseInt(org_elem.outerWidth());
110 var org_height = parseInt(org_elem.outerHeight());
111 var tip_w = tiptip_holder.outerWidth();
112 var tip_h = tiptip_holder.outerHeight();
113 var w_compare = Math.round((org_width - tip_w) / 2);
114 var h_compare = Math.round((org_height - tip_h) / 2);
115 var marg_left = Math.round(left + w_compare);
116 var marg_top = Math.round(top + org_height + opts.edgeOffset);
117 var t_class = "";
118 var arrow_top = "";
119 var arrow_left = Math.round(tip_w - 12) / 2;
120
121 if(opts.defaultPosition == "bottom"){
122 t_class = "_bottom";
123 } else if(opts.defaultPosition == "top"){
124 t_class = "_top";
125 } else if(opts.defaultPosition == "left"){
126 t_class = "_left";
127 } else if(opts.defaultPosition == "right"){
128 t_class = "_right";
129 }
130
131 var right_compare = (w_compare + left) < parseInt($(window).scrollLeft());
132 var left_compare = (tip_w + left) > parseInt($(window).width());
133
134 if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){
135 t_class = "_right";
136 arrow_top = Math.round(tip_h - 13) / 2;
137 arrow_left = -12;
138 marg_left = Math.round(left + org_width + opts.edgeOffset);
139 marg_top = Math.round(top + h_compare);
140 } else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){
141 t_class = "_left";
142 arrow_top = Math.round(tip_h - 13) / 2;
143 arrow_left = Math.round(tip_w);
144 marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5));
145 marg_top = Math.round(top + h_compare);
146 }
147
148 var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
149 var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
150
151 if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
152 if(t_class == "_top" || t_class == "_bottom"){
153 t_class = "_top";
154 } else {
155 t_class = t_class+"_top";
156 }
157 arrow_top = tip_h;
158 marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset));
159 } else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){
160 if(t_class == "_top" || t_class == "_bottom"){
161 t_class = "_bottom";
162 } else {
163 t_class = t_class+"_bottom";
164 }
165 arrow_top = -12;
166 marg_top = Math.round(top + org_height + opts.edgeOffset);
167 }
168
169 if(t_class == "_right_top" || t_class == "_left_top"){
170 marg_top = marg_top + 5;
171 } else if(t_class == "_right_bottom" || t_class == "_left_bottom"){
172 marg_top = marg_top - 5;
173 }
174 if(t_class == "_left_top" || t_class == "_left_bottom"){
175 marg_left = marg_left + 5;
176 }
177 tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"});
178 tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class);
179
180 if (timeout){ clearTimeout(timeout); }
181 timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
182 }
183
184 function deactive_tiptip(){
185 opts.exit.call(this);
186 if (timeout){ clearTimeout(timeout); }
187 tiptip_holder.fadeOut(opts.fadeOut);
188 }
189 }
190 });
191 }
192 })(jQuery);
193