help.page.js
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* [帮助中心]
* @author: jiangmin
* @date: 2016/07/25
*/
var queryId = location.search.split('=')[1] || '1';
var $cate = $('.cateId-' + queryId);// 当前分类
var $subsets = $('.subsets');
var parentID = queryId.substr(0, 1);// 一级分类id
require('../common/header');
require('../common/return-top');
/**
* 目录切换
*/
$subsets.click(function() {
var $this = $(this);
var className = $this.attr('class').split(' ')[1];
var parentId = 'parentId-' + className.split('-')[1];
var $child = $this.parent().find('.' + parentId);// 当前子分类
if ($this.hasClass('open')) {
$child.hide();
$this.removeClass('open').children('.plus').css('background-image', 'url(\'../img/help/plus.png\')');
} else {
$('.smll-category').hide();
$('.subsets').children('.plus').css('background-image', 'url(\'../img/help/plus.png\')');
$child.show();
$subsets.removeClass('open');
$this.addClass('open').children('.plus').css('background-image', 'url(\'../img/help/minus.png\')');
}
});
if (!$cate.hasClass('big-category')) {
$('.parentId-' + parentID).show();
$('.cateId-' + parentID).find('.plus').css('background-image', 'url(\'../img/help/minus.png\')');
}
$('.center-content').css('border-top-color', '#fff');