Skip to content

Instantly share code, notes, and snippets.

@pafnuty
Created February 19, 2015 20:23
Show Gist options
  • Save pafnuty/44d0d01d4fb8d8a67876 to your computer and use it in GitHub Desktop.
Save pafnuty/44d0d01d4fb8d8a67876 to your computer and use it in GitHub Desktop.
antiHide.min
/**
* Плагин : jQuery.antiHide
* Версия : 1.0 (19.02.2015)
* Автор : ПафНутиЙ
* Twitter : @pafnuty_name
* Назначение : Детектор недостаточной, по мнению вебмастера, высоты блоков на сайте (AdBlock-детектор)
*/
!function(n,t){var i=!1,e={minHeight:0,callback:function(){}},r={init:function(i){var a=n.extend({},e,i),o=this,u=function(){r.run(o,a)};return n(t).on("load.antiHide",o,u),this},run:function(t,e){return n.each(t,function(){var t=(n(this),n(this).height());return t<=e.minHeight?(i=!0,e.callback.call(this),!1):void 0}),i?!0:!1}};n.fn.antiHide=function(t){return r[t]?r[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Метод с именем "+t+" не существует для jQuery.antiHide"):r.init.apply(this,arguments)}}(jQuery,window,document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment