1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /*
- * Pin compatibility patch
- * http://pin.jaysalvat.com
- */
- /* global Pin: true */
- (function ($) {
- 'use strict';
- if ($ && $.pin) {
- $.fn.addClass = function (name) {
- return this.set('.' + name);
- };
- $.fn.hasClass = function (name) {
- return this.get('.' + name);
- };
- $.fn.removeClass = function (name) {
- return this.set('.' + name, 'remove');
- };
- $.fn.css = function (key, value) {
- if (value === undefined) {
- return this.get(':' + key);
- }
- return this.set(':' + key, value);
- };
- $.fn.attr = function (key, value) {
- if (value === undefined) {
- return this.get('@' + key);
- }
- return this.set('@' + key, value);
- };
- $.fn.fadeIn = function (duration) {
- return this.each(function () {
- var self = this,
- start = new Date(),
- from = 0,
- intvl = setInterval(function() {
- var passed = new Date() - start,
- progress = passed / duration;
- self.style.opacity = from + progress;
- if (progress >= 1) {
- clearInterval(intvl);
- }
- }, duration || 100);
- });
- };
- }
- })(typeof Pin !== 'undefined' ? Pin : null);
|