You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/public/javascripts/edu/user.js

78 lines
2.5 KiB

6 years ago
/**
* Created by cxt on 2017/4/18.
*/
//---------------------------我的关注-----------------------------//
$(function(){
$("#my_watchlist_span").live('click', function(){
$("#my_fanlist_span").removeClass('bold');
$("#my_fanlist_span").find('i').hide();
$("#my_watchlist_span").addClass('bold');
$("#my_watchlist_span").find('i').show();
$("#my_fanlist").hide();
$("#my_watchlist").show();
});
$("#my_fanlist_span").live('click', function(){
$("#my_watchlist_span").removeClass('bold');
$("#my_fanlist_span").find('i').show();
$("#my_watchlist_span").find('i').hide();
$("#my_fanlist_span").addClass('bold');
$("#my_watchlist").hide();
$("#my_fanlist").show();
});
var nTabCourse = $("#my_courses_span"); // 课堂tab
var nTabShixun = $("#my_shixuns_span"); // 实训tab
var dCourse = $("#my_courses_list"); // 课堂列表
var dShixun = $("#my_shixuns_list"); // 实训列表
/*---------------------- 课堂tab点击事件 -------------------------*/
nTabCourse.live('click', function(){
$.ajax({
url: '/users/' + $("#current_user_id").val(),
async: false
});
nTabShixun.removeClass("edu-new-tab-hover");
nTabCourse.addClass("edu-new-tab-hover");
dCourse.show();
dShixun.hide();
});
/*---------------------- 实训tab点击事件 -------------------------*/
nTabShixun.live('click', function(){
$.ajax({
url: '/users/' + $("#current_user_id").val(),
async: false
});
nTabCourse.removeClass("edu-new-tab-hover");
nTabShixun.addClass("edu-new-tab-hover");
dCourse.hide();
dShixun.show();
});
});
//---------------------------修改个人简介-----------------------------//
$(function(){
$("#user_breif_introduction").on('blur', function(){
$.post(
'/users/' + $("#current_user_id").val() + '/edit_brief_introduction',
{ brief_introduction: $("#user_breif_introduction").val() },
function (data) {
}
);
});
});
//---------------------------取消关注/关注-----------------------------//
$(function(){
$("#cancel_watch").live('mouseenter',function(){
$("#cancel_watch").html("取消关注");
});
$("#cancel_watch").live('mouseleave',function(){
$("#cancel_watch").html("已关注");
});
});