PageSourceSearch

https://mainewine.com/wp-content/plugins/vc-instagram-feed/assets/js/jquery.flexverticalcenter.js?ver=6.9.8

js mainewine.com collected 2026-10-02 16:27:26 UTC 1,881 bytes, 57 lines download raw bytes

1/*global jQuery */
2/*!
3* FlexVerticalCenter.js 1.0
4*
5* Copyright 2011, Paul Sprangers http://paulsprangers.com
6* Released under the WTFPL license
7* http://sam.zoy.org/wtfpl/
8*
9* Date: Fri Oct 28 19:12:00 2011 +0100
10*/
11(function( $ ){
12
13  $.fn.flexVerticalCenter = function( options ) {
14    var settings = $.extend({
15      cssAttribute:   'margin-top', // the attribute to apply the calculated value to
16      verticalOffset: 0,            // the number of pixels to offset the vertical alignment by
17      parentSelector: null,         // a selector representing the parent to vertically center this element within
18      debounceTimeout: 25,          // a default debounce timeout in milliseconds
19      deferTilWindowLoad: false     // if true, nothing will take effect until the $(window).load event
20    }, options || {});
21
22    return this.each(function(){
23      var $this   = $(this); // store the object
24      var debounce;
25
26      // recalculate the distance to the top of the element to keep it centered
27      var resizer = function () {
28
29        var parentHeight = (settings.parentSelector && $this.parents(settings.parentSelector).length) ?
30          $this.parents(settings.parentSelector).first().height() : $this.parent().height();
31
32        $this.css(
33          settings.cssAttribute, ( ( ( parentHeight - $this.height() ) / 2 ) + parseInt(settings.verticalOffset) )
34        );
35      };
36
37      // Call on resize. Opera debounces their resize by default.
38      $(window).resize(function () {
39          clearTimeout(debounce);
40          debounce = setTimeout(resizer, settings.debounceTimeout);
41      });
42
43      if (!settings.deferTilWindowLoad) {
44        // call it once, immediately.
45        resizer();
46      }
47
48      // Call again to set after window (frames, images, etc) loads.
49      $(window).load(function () {
50          resizer();
51      });
52
53    });
54
55  };
56
57})( jQuery );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.