public.js
3.0 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
$(function(){
var host = 'http://'+window.location.host;
// 点击收藏与爱心
$('.collections').click(function() {
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_15.png');
} else {
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png');
}
});
$('.likes').click(function() {
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png') {
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_16.png');
} else {
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png');
}
});
// 评论判断长度显示与隐藏
if ($('.show_2_pinL').length < 2) {
$('.show_main_more').hide();
$('.show_main2_show ul').removeClass('show_main2_show_H');
} else {
$('.show_main_more').show();
}
// 点击查看更多,与提示
$('.show_main_more').click(function() {
if ($(this).text() == "查看更多评论") {
$('.show_main2_show ul').removeClass('show_main2_show_H');
$(this).text('收起');
} else {
$('.show_main2_show ul').addClass('show_main2_show_H');
$(this).text('查看更多评论');
}
});
//头部导航栏切换颜色
var str_url = window.location.pathname;
$('.home_nav_act,.slide_vo').children('a').removeClass('home_nav_act');
var star = 'star';//星球奇境
var region = 'region';//星域秀场
var enjoy = 'enjoy';//星享体验
var scout = 'scout';//星探推荐
var active = 'active';//星际活动
if(str_url.indexOf(star) != -1){
$('.slide_vo').eq(0).children('a').addClass('home_nav_act');
}else if(str_url.indexOf(region) != -1){
$('.slide_vo').eq(1).children('a').addClass('home_nav_act');
}else if(str_url.indexOf(enjoy) != -1){
$('.slide_vo').eq(2).children('a').addClass('home_nav_act');
}else if(str_url.indexOf(scout) != -1){
$('.slide_vo').eq(3).children('a').addClass('home_nav_act');
}else if(str_url.indexOf(active) != -1){
$('.slide_vo').eq(4).children('a').addClass('home_nav_act');
}else{
$('.home_nav_act').children('a').addClass('home_nav_act');
}
//改变分页图标
$('.page-item').eq(0).children().text('<');
$('.page-item:last').children().text('>');
//注册页面
$('#register').click(function(){
window.location.href = '/portal/login/register';
});
//登录页面
$('#login').click(function(){
window.location.href = '/portal/login/login';
});
});
//弹框
function mask(msg) {
$('.mask').text(msg);
$('.mask').show();
setTimeout(function(){
$('.mask').hide();
$('.mask').text('');
},4000);
}