140 lines
3.5 KiB
JavaScript
140 lines
3.5 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
//mobile-menu
|
|
$(".mobileMenu").click(function(){
|
|
$(".sideMenu").toggleClass("side-menu-open");
|
|
});
|
|
//login-mobile-menu
|
|
$(".login-mob-menu").click(function(){
|
|
$(".mob-menu").toggleClass("mob-menu-open");
|
|
});
|
|
$(".quest-added").click(function(){
|
|
$(this).toggleClass("quest-added-green");
|
|
});
|
|
$(".check-inactive").click(function(){
|
|
$(this).find(".mark-around").toggleClass("mark-green");
|
|
});
|
|
//Calendar
|
|
$(function () {
|
|
$("#Datepicker1").datepicker({
|
|
numberOfMonths: 1,
|
|
changeYear:true,
|
|
changeMonth:true,
|
|
showOtherMonths:true
|
|
});
|
|
});
|
|
//owl-carousel-syllabus-modal
|
|
$('ul.tabs li').click(function(){
|
|
var tab_id = $(this).attr('data-tab');
|
|
$('ul.tabs li').removeClass('current');
|
|
$('.tab-content').removeClass('current');
|
|
$(this).addClass('current');
|
|
$("#"+tab_id).addClass('current');
|
|
})
|
|
$('.slider1').on('initialized.owl.carousel changed.owl.carousel', function(i) {
|
|
if (!i.namespace) {
|
|
return;
|
|
}
|
|
var carousel1 = i.relatedTarget;
|
|
$('.slider-no1').text(carousel1.relative(carousel1.current()) + 1 );
|
|
$('.tot-slider1').text('/' + carousel1.items().length)
|
|
}).owlCarousel({
|
|
items: 1,
|
|
loop:false,
|
|
margin:0,
|
|
nav:true
|
|
});
|
|
//owl carousel-assignment-modal
|
|
$('.slider').on('initialized.owl.carousel changed.owl.carousel', function(e) {
|
|
if (!e.namespace) {
|
|
return;
|
|
}
|
|
var carousel = e.relatedTarget;
|
|
$('.slider-no').text(carousel.relative(carousel.current()) + 1);
|
|
$('.tot-slider').text('/' + carousel.items().length);
|
|
}).owlCarousel({
|
|
items: 1,
|
|
loop:false,
|
|
margin:0,
|
|
nav:true
|
|
});
|
|
$('.slider3').on('initialized.owl.carousel changed.owl.carousel', function(i) {
|
|
if (!i.namespace) {
|
|
return;
|
|
}
|
|
var carousel1 = i.relatedTarget;
|
|
$('.slider-no3').text(carousel1.relative(carousel1.current()) + 1 );
|
|
$('.tot-slider3').text('/' + carousel1.items().length);
|
|
}).owlCarousel({
|
|
items: 1,
|
|
loop:false,
|
|
margin:0,
|
|
nav:true
|
|
});
|
|
//owl-carousel-view-assignment
|
|
$('.slider4').on('initialized.owl.carousel changed.owl.carousel', function(k) {
|
|
if (!k.namespace) {
|
|
return;
|
|
}
|
|
var carousel4 = k.relatedTarget;
|
|
$('.slider-counter4').text(carousel4.relative(carousel4.current()) + 1 + '/' + (carousel4.items().length)) ;
|
|
}).owlCarousel({
|
|
items: 1,
|
|
loop:false,
|
|
margin:0,
|
|
nav:true
|
|
});
|
|
//to show input image in a div
|
|
function readURL(input) {
|
|
if (input.files && input.files[0]) {
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function (e) {
|
|
$('#upImage').attr('src', e.target.result);
|
|
}
|
|
reader.readAsDataURL(input.files[0]);
|
|
}
|
|
}
|
|
$("#imgInp").change(function(){
|
|
readURL(this);
|
|
});
|
|
});
|
|
|
|
//file-upload
|
|
var input = document.getElementById( 'upload1' );
|
|
var infoArea = document.getElementById( 'uploaded-file1' );
|
|
//input.addEventListener( 'change', showFileName );
|
|
|
|
function showFileName( event ) {
|
|
var input = event.srcElement;
|
|
var fileName = input.files[0].name;
|
|
infoArea.textContent = fileName;
|
|
}
|
|
|
|
// Hides Notification from header Menu
|
|
function delete_notificaton(id, parentLi) {
|
|
parentLi.hide();
|
|
|
|
$.ajax({
|
|
url : 'ajax_hide_notification_msg',
|
|
data : {notifid : id},
|
|
type : 'POST',
|
|
async : false,
|
|
success: function(data){
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
if($('.nepal-date-student').length > 0) {
|
|
|
|
$('.nepal-date-student').nepaliDatePicker({
|
|
language : 'english',
|
|
ndpYear: true,
|
|
ndpMonth: true,
|
|
ndpYearCount: 10
|
|
})
|
|
|
|
}
|