$(document).ready(function() {
// modal
$('.modal').each(function(){
var src = $(this).find('iframe').attr('src');
$(this).on('click', function(){
$(this).find('iframe').attr('src', '');
$(this).find('iframe').attr('src', src);
});
});
// thumb
$('.owl-thumb').owlCarousel({
nav: false,
dots: false,
loop: true,
items: 1,
autoplay: true,
autoplayTimeout: 3000,
thumbs: true,
thumbImage: true,
thumbContainerClass: 'owl-thumbs',
thumbItemClass: 'owl-thumb-item'
});
// gallery
$('#owl-gallery').owlCarousel({
smartSpeed: 660,
nav: false,
dots: true,
loop: true,
margin: 10,
autoplay: true,
autoplayTimeout: 3000,
autoplaySpeed: 500,
thumbs: false,
responsive: {
0: {
items: 1,
},
768: {
items: 2,
},
1200: {
items: 3,
},
}
});
// product
$('.owl-default').owlCarousel({
nav: true,
navText: ["", ""],
loop: true,
items: 1,
autoplay: true,
autoplayTimeout: 6000,
autoplayHoverPause: true,
thumbs: false,
});
// Main visual
$('#main_visual').owlCarousel({
nav: true,
navText: ["", ""],
loop: true,
items: 1,
autoplay: true,
autoplayTimeout: 6000,
autoplayHoverPause: true,
thumbs: false,
});
// card
$(document).ready(function() {
$('.tcards').owlCarousel({
loop: true,
margin: 30,
center: false,
stagePadding: 15,
nav: true,
navText: ["", ""],
dots: true,
autoplay: true,
autoplayTimeout: 2000,
autoplayHoverPause: true,
responsiveClass: true,
responsive: {
0: {
items: 1,
nav: false
},
768: {
items: 2
},
1170: {
items: 5
}
}
});
});
// Main slide
function active_course() {
if ($(".active_course").length) {
$(".active_course").owlCarousel({
loop: true,
margin: 20,
items: 4,
nav: true,
autoplay: 2500,
smartSpeed: 1500,
dots: false,
responsiveClass: true,
thumbs: true,
thumbsPrerendered: true,
navText: ["", ""],
responsive: {
0: {
items: 1,
margin: 0
},
576: {
items: 2,
margin: 5
},
992: {
items: 3,
margin: 5
},
1200: {
items: 4,
margin: 5
}
}
});
}
}
active_course();
// Main
$('.testi7').owlCarousel({
loop: true,
margin: 30,
nav: false,
navText: ["", ""],
dots: true,
autoplay: true,
center: true,
responsiveClass: true,
responsive: {
0: {
items: 1
},
1650: {
items: 1
}
}
});
// Main
$(document).ready(function() {
$('.main_tcards').owlCarousel({
loop: true,
margin: 30,
center: false,
stagePadding: 15,
nav: false,
navText: ["", ""],
dots: true,
autoplay: true,
autoplayTimeout: 2000,
autoplayHoverPause: true,
responsiveClass: true,
responsive: {
0: {
items: 1,
nav: false
},
768: {
items: 2
},
1170: {
items: 3
}
}
});
});
// imgbg
$('.imgbg-view').each(function() {
var b = $(this).children('img').attr('src');
$(this).css('background', 'url("' + b + '")')
});
// Board
$("#border[name='password']").attr("size", "50");
$(".table1-list td[width='26']").css("font-size", "0");
$(".table1-write table.board").addClass("innerTable");
$(".table1-modify table.board").addClass("innerTable");
});
// Auto select sub navbar
$(document).ready(function() {
var str = location.href.toLowerCase();
$('.sub-navbar>li>a').each(function() {
if (str.indexOf(this.href.toLowerCase()) > -1) {
$(".sub-navbar>li.active").removeClass("active");
$(this).parent().addClass("active");
}
});
$('li.active').parents().each(function() {
if ($(this).is('li')) {
$(this).addClass("active");
}
});
});
$(document).ready(function() {
var e = document.querySelector(".navbar")
, t = document.querySelector(".navbar-collapse")
, o = !1
, a = !1
, n = e.classList.contains("navbar-togglable");
function l() {
!o && n && (e.classList.remove("navbar-dark"),
e.classList.add("navbar-light"),
o = !0)
}
function r() {
o && n && (e.classList.remove("navbar-light"),
e.classList.add("navbar-dark"),
o = !1)
}
function i(e, t) {
if ("fpOnLeave" == e)
0 == t ? r() : l();
else if ("collapse" == e) {
0 == (n = window.pageYOffset) && a ? r() : l()
} else if ("scroll" == e || "load" == e) {
var n;
0 == (n = window.pageYOffset) && !a && o ? r() : 0 === n || o || l()
}
}
"load scroll fpOnLeave".split(" ").forEach(function(e) {
window.addEventListener(e, function(e) {
i(e.type, e.detail ? e.detail.destination.index : void 0)
})
}),
$(t).on({
"show.bs.collapse": function() {
i("collapse"),
a = !0
},
"hidden.bs.collapse": function() {
i("collapse"),
a = !1
}
})
});
$(document).ready(function() {
var e = document.querySelectorAll(".dropup, .dropright, .dropdown, .dropleft")
, t = document.querySelectorAll(".dropdown-menu .dropdown-toggle");
t && [].forEach.call(t, function(a) {
a.addEventListener("click", function(e) {
var t, n, o;
e.preventDefault(),
e.stopPropagation(),
n = (t = a).closest(".dropdown-menu").querySelectorAll(".dropdown-menu"),
o = t.parentElement.querySelector(".dropdown-menu"),
[].forEach.call(n, function(e) {
e !== o && e.classList.remove("show")
}),
o.classList.toggle("show")
})
}),
$(e).on("hide.bs.dropdown", function(e) {
var t;
t = this.querySelectorAll(".dropdown-menu"),
[].forEach.call(t, function(e) {
e.classList.remove("show")
})
})
});
// Background Set
$('.set-bg').each(function () {
var bg = $(this).data('setbg');
$(this).css('background-image', 'url(' + bg + ')');
});
//Canvas Menu
$(".canvas__open").on('click', function () {
$(".offcanvas-menu-wrapper").addClass("active");
$(".offcanvas-menu-overlay").addClass("active");
});
$(".offcanvas-menu-overlay").on('click', function () {
$(".offcanvas-menu-wrapper").removeClass("active");
$(".offcanvas-menu-overlay").removeClass("active");
});