index.js
778 Bytes
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/19
* Time: 10:16
*/
var $ = require('yoho-jquery'),
Vue = require('yoho-vue');
var letterList = require('channel/letter-list.vue');
var $expand = $('.expand'),
$collapse = $('.collapse'),
$brandIntro = $('.brand-intro'),
exCoTm = 6; // 展开隐藏的倍数
new Vue({
el: '#letter-list',
components: {
letterList: letterList
}
});
$expand.on('click', function() {
$brandIntro.removeClass('line-clamp').animate({height: $brandIntro.height() * exCoTm});
$expand.hide();
$collapse.show();
});
$collapse.on('click', function() {
$brandIntro.addClass('line-clamp').animate({height: $brandIntro.height() / exCoTm});
$collapse.hide();
$expand.show();
});