12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import $ from "jquery";
- const $window = $(window);
- const $doc = $(document);
- const $$ = {
- $window: $window,
- $doc: $doc,
- getHeight: function (node) {
- return $(node).innerHeight();
- },
- getWidth: function (node) {
- return $(node).innerWidth();
- },
- animate: {
- left: function (el, left) {
-
- },
- top: function (el, top) {
-
- },
- slideDown: function ($el, cb) {
- let h = $el.height();
- let cacheH = 0;
- let timer = setInterval(function () {
- $el.height(cacheH);
- cacheH++;
- if(cacheH >= h) {
- clearInterval(timer);
- cb && cb();
- }
- }, 20);
-
- },
- slideUp: function ($el, cb) {
- let h = $el.height();
-
- let cacheH = 0;
- let timer = setInterval(function () {
- $el.height(cacheH);
- cacheH--;
- if(cacheH <= 0) {
- clearInterval(timer);
- $el.height(h);
- cb && cb();
- }
- }, 20);
-
- }
- }
- }
- module.exports = $$;
|