Authored by ccbikai

上滑收起TAB

... ... @@ -11,6 +11,7 @@ var $ = require('yoho-jquery'),
PullRefresh = require('../plugin/pull-refresh');
var $window = $(window),
$headTab = $('.head-tab'),
$starArticle = $('.star-article');
/*
... ... @@ -49,8 +50,28 @@ $(function() {
starIScroll.iScroll.on('scrollStart', function() {
$window.trigger('scroll');
});
// starIScroll.iScroll.on('scroll', function() {
// var scale = 1;
//
// if (this.y < 0 && this.startY > -40) {
// console.log(headTabHeight + this.startY);
// scale = 2 / headTabHeight;
// }
// $headTab.css({
// transfrom: 'scale(' + scale + ')'
// });
// });
starIScroll.iScroll.on('scrollEnd', function() {
$window.trigger('scroll');
// 上滑
if (this.directionY === 1) {
$headTab.addClass('hide-tab');
} else {
$headTab.removeClass('hide-tab');
}
});
});
... ...
var $ = require('yoho-jquery'),
IScroll = require('yoho-iscroll');
IScroll = require('yoho-iscroll/build/iscroll-probe');
// 下拉刷新,上滑加载插件
// 参数一选择器,参数二选项
... ... @@ -29,12 +29,15 @@ function PullRefresh(seclector, options) {
return;
}
$em.height(options.height);
if (options.height) {
$em.height(options.height);
}
topOffset = -$em.outerHeight();
this.iScroll = new IScroll($em.get(0), {
click: true
click: true,
probeType: 3
});
this.iScroll.on('scrollStart', function() {
... ...
... ... @@ -28,6 +28,13 @@
height: 88px;
background: #000;
z-index: 1;
transform-origin: top;
transform: scale(1, 1);
transition: transform 400ms;
&.hide-tab {
transform: scale(1, 0);
}
li {
width: 33.3%;
... ...