Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function () {
- jQuery('.responsive-takeover').wanker({
- delay: 1000,
- duration: 2000,
- });
- });
- (function () {
- (function ($) {
- return $.fn.wanker = function (options) {
- var settings;
- settings = $.extend({
- delay: 1000,
- duration: 1500
- }, options);
- return this.each(function () {
- var $message, elapsed, fired, mobile, reset, start, timer;
- $message = $(this);
- mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
- if (!mobile) {
- fired = false;
- start = null;
- elapsed = null;
- timer = null;
- reset = function () {
- fired = false;
- return elapsed = null;
- };
- return $(window).resize(function () {
- if (fired) {
- elapsed = Math.abs(new Date() - start);
- } else {
- start = new Date();
- fired = true;
- }
- if (elapsed > settings.delay) {
- $message.fadeIn();
- }
- if (timer) {
- clearTimeout(timer);
- }
- return timer = setTimeout(function () {
- $message.fadeOut();
- return reset();
- }, settings.duration);
- });
- }
- });
- };
- })(jQuery);
- }).call(this);;
Advertisement
Add Comment
Please, Sign In to add comment