Blame view

public/js/home/online-service.page.js 764 Bytes
zhangxiaoru authored
1 2 3 4 5
/**
 * 在线客服
 * @author: bikai<kai.bi@yoho.cn>
 * @date: 2015/11/16
 */
lijing authored
6
let $ = require('yoho-jquery');
zhangxiaoru authored
7
lijing authored
8
let $questionTab = $('.question-tab .tab-item');
zhangxiaoru authored
9
10
require('common');
zhangxiaoru authored
11
zhangxiaoru authored
12
$questionTab.on('touchend', function() {
lijing authored
13
    let clickTab = $(this).data('tab');
zhangxiaoru authored
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

    clickTab = '[data-tab-name="' + clickTab + '"]';

    $questionTab.removeClass('current');
    $(this).addClass('current');

    $('.question-list').removeClass('current');
    $(clickTab).addClass('current');
});

$('.yoho-page').on('touchstart', '.connect-item, .question-item', function() {
    $(this).siblings().removeClass('highlight');
    $(this).addClass('highlight');
}).on('touchend touchcancel', '.connect-item, .question-item', function() {
    $(this).removeClass('highlight');
});