var pflag = 1; $(document).ready(function () { var vu = $('#varData1').val(); var start_from = 0; var limit_val = 9; var v = false; var lastFlag = false; var clastFlag = false; getUserProfile(vu); getUserSocial(vu); getUserCourses(vu, 'box', start_from, limit_val,true); getUserEnrollCourses(vu, 'box', start_from, limit_val); getUserFollowing(vu); getUserFollowers(vu); $("#ancViewCourses").on('click', function () { $('html, body').animate({ 'scrollTop': $("#coursesDiv").position().top + 390 }); }); $("#ancEnrollToggleList").on('click', function () { var ty = $(this).data('type'); start_from = 0; lastFlag = false; $('#ancCourseMore').show(); $("#ancCourseMore").data('type', ty); getUserEnrollCourses(vu, ty, start_from, limit_val); }); $("#ancEnrollCourseMore").on('click', function () { var ty = $(this).data('type'); start_from = start_from + limit_val; if (lastFlag == false) { getUserEnrollCourses(vu, ty, start_from, limit_val,true); } }); $("#ancToggleList").on('click', function () { var ty = $(this).data('type'); start_from = 0; lastFlag = false; $('#ancCourseMore').show(); $("#ancCourseMore").data('type', ty); getUserCourses(vu, ty, start_from, limit_val); }); $("#ancCourseMore").on('click', function () { var ty = $(this).data('type'); start_from = start_from + limit_val; if (clastFlag == false) { getUserCourses(vu, ty, start_from, limit_val,true); } }); $("#ancViewFollowing").on('click', function () { $('html, body').animate({ 'scrollTop': $("#followingDiv").position().top + 390 }); }); $("#ancViewFollowers").on('click', function () { $('html, body').animate({ 'scrollTop': $("#followersDiv").position().top + 390 }); }); function getUserProfile(vu) { $.ajax({ url: videobaseurl + "/ajax/ajaxGetUserPersonal.php", method: "POST", data: {'vu': vu} }).done(function (returnData) { $('#personalDisplayDiv').html(returnData); }); } function getUserSocial(vu) { $.ajax({ url: videobaseurl + "/ajax/ajaxGetUserSocailList.php", method: "POST", data: {'vu': vu} }).done(function (returnData) { $('#socialDisplayDiv').html(returnData); }); } function getUserEnrollCourses(vu, ty, start_from, limit_val,heightFlag=false) { $.ajax({ url: videobaseurl + "/ajax/ajaxGetUserEnrollCourses.php", method: "POST", data: {'vu': vu, "type": ty, "start_from": start_from, "limit_val": limit_val} }).done(function (returnData) { if (returnData == '') { lastFlag = true; $('#enrollDisplayDiv').append("