PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.6
Strong Testimonials v3.3.6
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / assets / public / js / lib / actual / jquery-actual.js
strong-testimonials / assets / public / js / lib / actual Last commit date
jquery-actual.js 1 year ago jquery-actual.min.js 1 year ago jquery.min.js 1 year ago
jquery-actual.js
107 lines
1 /*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
2 * Licensed under the MIT License (LICENSE.txt).
3 *
4 * Version: 1.0.19
5 *
6 * Requires: jQuery >= 1.2.3
7 */
8 ;( function ( factory ) {
9 if ( typeof define === 'function' && define.amd ) {
10 // AMD. Register module depending on jQuery using requirejs define.
11 define( ['jquery'], factory );
12 } else {
13 // No AMD.
14 factory( jQuery );
15 }
16 }( function ( $ ){
17 $.fn.addBack = $.fn.addBack || $.fn.andSelf;
18
19 $.fn.extend({
20
21 actual : function ( method, options ){
22 // check if the jQuery method exist
23 if( !this[ method ]){
24 throw '$.actual => The jQuery method "' + method + '" you called does not exist';
25 }
26
27 var defaults = {
28 absolute : false,
29 clone : false,
30 includeMargin : false,
31 display : 'block'
32 };
33
34 var configs = $.extend( defaults, options );
35
36 var $target = this.eq( 0 );
37 var fix, restore;
38
39 if( configs.clone === true ){
40 fix = function (){
41 var style = 'position: absolute !important; top: -1000 !important; ';
42
43 // this is useful with css3pie
44 $target = $target.
45 clone().
46 attr( 'style', style ).
47 appendTo( 'body' );
48 };
49
50 restore = function (){
51 // remove DOM element after getting the width
52 $target.remove();
53 };
54 }else{
55 var tmp = [];
56 var style = '';
57 var $hidden;
58
59 fix = function (){
60 // get all hidden parents
61 $hidden = $target.parents().addBack().filter( ':hidden' );
62 style += 'visibility: hidden !important; display: ' + configs.display + ' !important; ';
63
64 if( configs.absolute === true ) style += 'position: absolute !important; ';
65
66 // save the origin style props
67 // set the hidden el css to be got the actual value later
68 $hidden.each( function (){
69 // Save original style. If no style was set, attr() returns undefined
70 var $this = $( this );
71 var thisStyle = $this.attr( 'style' );
72
73 tmp.push( thisStyle );
74 // Retain as much of the original style as possible, if there is one
75 $this.attr( 'style', thisStyle ? thisStyle + ';' + style : style );
76 });
77 };
78
79 restore = function (){
80 // restore origin style values
81 $hidden.each( function ( i ){
82 var $this = $( this );
83 var _tmp = tmp[ i ];
84
85 if( _tmp === undefined ){
86 $this.removeAttr( 'style' );
87 }else{
88 $this.attr( 'style', _tmp );
89 }
90 });
91 };
92 }
93
94 fix();
95 // get the actual value with user specific methed
96 // it can be 'width', 'height', 'outerWidth', 'innerWidth'... etc
97 // configs.includeMargin only works for 'outerWidth' and 'outerHeight'
98 var actual = /(outer)/.test( method ) ?
99 $target[ method ]( configs.includeMargin ) :
100 $target[ method ]();
101
102 restore();
103 // IMPORTANT, this plugin only return the value of the first element
104 return actual;
105 }
106 });
107 }));